Using trunc function in Erlang

Erlang Questions erlang@REDACTED
Fri Dec 30 19:15:21 CET 2005


Hello everybody, I have one question about Erlang trunc function.

Why Erlang behaves like this?

1> trunc(1.3/0.1).
13
2> trunc(1.4/0.1).
13
3> trunc(1.5/0.1).
15

And which you think is the best way to manage this in order to solve this kind of problems?

Thanks in advance.
Happy new year for everyone!!
Carlos.-
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20051230/f90d4fd7/attachment.htm>


More information about the erlang-questions mailing list