2009/7/8 Andres Valloud <avalloud@smalltalk.comcastbiz.net>:
Il y a même une infinité de Fractions r telles que f-0.5*ulp < r < f+0.5ulp
Yes... find two with small integer numerators and denominators... bonus points if you find fractions with small smallIntegers, too.
Anyway, Andres, tell me what how you can bear this VW behaviour I exposed to Michael L.S.
9.9999730e20 printString -> '1.0e21' 9.9999731e20 printString -> '9.99997e20' 9.9999731e20 >= 9.9999730e20. false
To me, this is a clear violation of ISO/IEC 10967-2 http://www.cs.chalmers.se/~kent/ISOStandards/SC22/WG11/LIA-2/N424.ps I guess "we Smalltalk guys are smarter and did not change things for 30 years, so why bother now" is our best argument :)
I don't know what the deal is with that. Â However, I am not surprised that relying on print strings for floating point numbers leads to bogus results.
I was trying to attack printString based on (log: 10) rounding error, but that is not the main problem. The main problem is 9.9999731e20 < 9.9999730e20: decimal->binary conversion is not monotonic.
On a more positive note, according to our current plans, VW 7.7 will provide vastly improved IEEE arithmetic including proper support for INF and NaN.
Andres.
That's good news. Concerning NaN and Inf, I wonder if really a great idea. This introduces all sort of complexifications in the image. The main point of exceptional values is to avoid interrupting FP computations and rather introduce sparse tests at strategic points in code. It must be viewed as an optimization. Knowing that Smalltalk has all sort of overhead on FP computations, I wonder if adding a isFinite test in primitives at each operation and raising an Exception immediately rather than differed at chosen points was not a better compromise.... I guess the clients decide anyway... Will FP exceptions be programmable?
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project