[erlang-questions] Strange arithmetic behaviour

Gurgen Tumanian tumanian@REDACTED
Thu May 8 10:42:10 CEST 2008


Dear all.

There is some kind of strange behaviour that i have noticed when dealing
with big float values.
For example:

 123123123123123123123.0 - 123123123123123123121.0 is 0.00000e+0  when i
expect 2.0 or  something like that in e notation.
I found this kind of errors with round() and trunc(). for example:
trunc(1233333333333333123333333333.12311111111) is
1233333333333333065680814080.
or
round(1233333333333333123333333333.12311111111) is
1233333333333333065680814080.

furthermore
1233333333333333123333333333.12311111111 =
123333333333333312367575676573.92311111111 matches


I have tested this on R11-B5 and on R12-B1

Is this a big nasty bug, or am i missing something?

Regards
Gurgen Tumanyan
Smart Tech
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080508/48600cc6/attachment.htm>


More information about the erlang-questions mailing list