round / trunc

Danie Schutte danie@REDACTED
Tue Oct 5 15:40:32 CEST 2004


Strange scenario:
2 and 3 are correct but 4 is obviously wrong - any ideas as to why the
precision is so accurate?

2> round(list_to_float("9993.38")*100).
999338
3> trunc(list_to_float("9993.39")*100).
999339
4> trunc(list_to_float("9993.38")*100).
999337







More information about the erlang-questions mailing list