[erlang-bugs] Sum small floats and get erroneous result in R12B-2

Kenji Rikitake kenji.rikitake@REDACTED
Wed May 28 13:45:42 CEST 2008


Also reproducible on R12B2 running on Windows XP SP3 (Japanese version)
(Intel Core2Duo E6300) // Kenji Rikitake

Erlang (BEAM) emulator version 5.6.2 [smp:2] [async-threads:0]

Eshell V5.6.2  (abort with ^G)
1> 20.14+2.01
1> .
22.15
2> 20.15+2.01.
22.159999999999997
3> 20.16+2.01.
22.17
4> 21.15+2.01.
23.159999999999997
5> 120.15+2.01.
122.16000000000001

In the message <732f49190805280427g57151a7eyd9e8f5ce9f33c1b2@REDACTED>
dated Wed, May 28, 2008 at 01:27:27PM +0200,
Badlop <badlop@REDACTED> writes:

> Erlang (BEAM) emulator version 5.6.2 [source] [smp:2]
> [async-threads:0] [kernel-poll:false]
> 
> Eshell V5.6.2  (abort with ^G)
> 1> 20.14 + 2.01.
> 22.15
> 2> 20.15 + 2.01.
> 22.159999999999997
> 3> 20.16 + 2.01.
> 22.17
> 4> 21.15 + 1.01.
> 22.16
> 5> 120.15 + 2.01.
> 122.16000000000001
> 6> 1120.15 + 2.01.
> 1122.16
> 
> 
> We see that 1, 3, 4 and 6 provide the exact result.
> But the results of 2 and 5 look strange.
> 

> [1] It was reproducible with Debian package 1:12.b.2-dfsg-3 linux-x86
> and macosx-intel.



More information about the erlang-bugs mailing list