On Thu, 30 Jan 2014, Bruce wrote: > On Thu, 2014-01-30 at 10:33 +0000, Ricardo D??az Mart??n wrote: > > ? round (283.5 * 0.21, -2) > > very interesting. The miracles we call floats. > try > ? round (283.4999999999999999999996 * 0.209999999999999999996, -2) > 59.54 > > Strange and magical, we'd better wait on Benoit's call on this one. > > ? > Bruce
I wouldn't say magical. Disillusioning maybe :-) 0.21 is not exactly representable with a finite number of bits. That's why you should expect errors when computing with it. When you multiply, the absolute error can get relatively large, obviously. Regards, Tobi -- "There's an old saying: Don't change anything... ever!" -- Mr. Monk ------------------------------------------------------------------------------ WatchGuard Dimension instantly turns raw network data into actionable security intelligence. It gives you real-time visual feedback on key security issues and trends. Skip the complicated setup - simply import a virtual appliance and go from zero to informed in seconds. http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk _______________________________________________ Gambas-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/gambas-user
