arithmetic anomaly?

Johan Warlander johan@REDACTED
Wed Aug 11 09:03:02 CEST 2004


On Wed, 11 Aug 2004 00:05:55 -0500 (CDT), chas wrote
> with the erlang shell i get this:
> 
> (1024*1024-1) / 1024.
> 1024.00
> 
> the equivalent expression on the same platform (NetBSD on Intel) in
> the clisp implementation of common lisp gives me this:
> 
> (/ (- (* 1024 1024) 1) 1024.0)
> 1023.999

Well.. it's not exactly yesterday that I had my math classes, but rounding of
1023.999 to two decimals would go up, wouldn't it, since the third decimal is
>= 5? Thus, 1024.00.

Johan




More information about the erlang-questions mailing list