changeset 1462:aab2d7177d3d

Round very close-to-zero values to zero - makes tests pass on this 32-bit machine
author Chris Cannam
date Fri, 04 May 2018 14:05:41 +0100
parents 45519a9836e6
children 2b2b58ae8b59
files base/ScaleTickIntervals.h
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/base/ScaleTickIntervals.h	Thu May 03 15:24:06 2018 +0100
+++ b/base/ScaleTickIntervals.h	Fri May 04 14:05:41 2018 +0100
@@ -357,6 +357,10 @@
             if (roundTo != 0.0) {
                 value = roundTo * round(value / roundTo);
             }
+
+            if (fabs(value) < eps) {
+                value = 0.0;
+            }
             
             ticks.push_back(makeTick(instruction.display,
                                      instruction.precision,