[erlang-questions] Erlang Numbers

Bob Ippolito bob@REDACTED
Tue Jun 17 18:23:18 CEST 2014


Yes, floats may be (accurately) rounded when printed.


On Tue, Jun 17, 2014 at 11:21 AM, Camille Troillard <lists@REDACTED> wrote:

> Dear list,
>
> My question is surely outside the scope of Erlang, but I thought I’d ask
> it here as it is the language I will use, and I am sure you guys have
> experience in the domain of numbers.
>
> I understand Erlang uses the IEEE-754 specs for floating-point numbers
> arithmetic. So when I type in the console:
>
> 1> 0.2 + 0.1.
> 0.30000000000000004
>
> This is fine, I was expecting that. However, why the following works:
>
> 2> 0.1.
> 0.1
>
> Is it because of some rounding behaviour?
>
>
> Thanks!
> Camille
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140617/87907ffb/attachment.htm>


More information about the erlang-questions mailing list