J Pfersich wrote:
I got this...

st> var1 := 20 - 2.2325251 !
17.7674749000000
st> var1 printNl !
17.7674748999999
17.7674749000000

I know that the result isn't far off, but why didn't it round up to 17.7674749?
It's actually wrong:

st> ('17.7674748999999' asNumber = Var1)!
false
st> ('17.7674749000000' asNumber = Var1)!
true

Now that fast LargeIntegers are part of the system it's actually possible to write a better (and still simple) algorithm to print floats.

Paolo


_______________________________________________
help-smalltalk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-smalltalk

Reply via email to