float_to_list question

Mickael Remond mikl@REDACTED
Sat Dec 30 16:33:24 CET 2000


I must be missing something but here is what I get from the float_to_list
built-in function:

 12> float_to_list(1.0).
 "1.00000000000000000000e+00"

Ok. That seems nice.

 13> float_to_list(1.1).
 "1.10000000000000008882e+00"

Oh Oh. I was expecting:
"1.10000000000000000000e+00"

 14> float_to_list(1.2).
 "1.19999999999999995559e+00"

Weird ! I was expecting:
"1.20000000000000000000e+00"


Can someone help me to understand this strange results ?

-- 
Mickaël



More information about the erlang-questions mailing list