From c8468958773435138478afeb20b53684c11a19a2 Mon Sep 17 00:00:00 2001 From: Mark Olesen <Mark.Olesen@esi-group.com> Date: Mon, 30 Oct 2017 11:38:24 +0100 Subject: [PATCH] STYLE: consistent rounding for float/double underflow (issue #625) - use (value <= VSMALL) instead of (value < VSMALL) for consistency with what equal(value, 0) delivers. --- src/OpenFOAM/primitives/Scalar/Scalar.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenFOAM/primitives/Scalar/Scalar.C b/src/OpenFOAM/primitives/Scalar/Scalar.C index d94c3c31c4..99e1b1c7c9 100644 --- a/src/OpenFOAM/primitives/Scalar/Scalar.C +++ b/src/OpenFOAM/primitives/Scalar/Scalar.C @@ -115,7 +115,7 @@ bool readScalar(const char* buf, Scalar& val) // Round underflow to zero val = ( - (parsed > -ScalarVSMALL && parsed < ScalarVSMALL) + (parsed >= -ScalarVSMALL && parsed <= ScalarVSMALL) ? 0 : Scalar(parsed) ); -- GitLab