Am 17.02.2014 um 14:48 schrieb Jeff Epler <[email protected]>: >> N..... SET_G92_OFFSET(-0.1000, -0.2000, -10.3000, 0.0000, 0.0000, 0.0000) > .. >> - N..... MESSAGE(" X0.000000 Y0.000000 Z-10.000000") >> + N..... MESSAGE(" X-0.000000 Y0.000000 Z-10.000000") > > Is the value really 0.0 or is it -0.0? These are distinct values in > IEEE floating-point arithmetic. If either of them is printed wrong, > then that's a libc bug. Otherwise, my second guess would be that damned > -ffast-math compiler flag, which enables -funsafe-math-optimizations, > which enables -fassociative-math, which "may change the sign of zero". > Third guess, they're distinct nonzero numbers with the significant > figures past the printed decimal digits. > > I didn't look closely at the test, but maybe it could be papered over by > ensuring that all the coordinates are expected to be nonzero in that > message. If it's the third case, then choosing numbers that are exact > floating-point values might help (e.g., not -0.1, but -0.125 which is a > binary fraction)
Proposal: The interpreter considers values closer than TOLERANCE_EQUAL to be identical anyway, see interp_internal.hh: > #define TOLERANCE_EQUAL 0.0001 /* two numbers compare EQ if the > difference is less than this */ > therefore I would think treating values from -TOLERANCE_EQUAL..TOLERANCE_EQUAL as 0.0 would be ok, and that would take care of the issue for good - Michael > > Jeff > > ------------------------------------------------------------------------------ > Android apps run on BlackBerry 10 > Introducing the new BlackBerry 10.2.1 Runtime for Android apps. > Now with support for Jelly Bean, Bluetooth, Mapview and more. > Get your Android app in front of a whole new audience. Start now. > http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk > _______________________________________________ > Emc-developers mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/emc-developers ------------------------------------------------------------------------------ Android apps run on BlackBerry 10 Introducing the new BlackBerry 10.2.1 Runtime for Android apps. Now with support for Jelly Bean, Bluetooth, Mapview and more. Get your Android app in front of a whole new audience. Start now. http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk _______________________________________________ Emc-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-developers
