<div dir="ltr">Yes, floats may be (accurately) rounded when printed.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jun 17, 2014 at 11:21 AM, Camille Troillard <span dir="ltr"><<a href="mailto:lists@tuli.pe" target="_blank">lists@tuli.pe</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear list,<br>
<br>
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.<br>
<br>
I understand Erlang uses the IEEE-754 specs for floating-point numbers arithmetic. So when I type in the console:<br>
<br>
1> 0.2 + 0.1.<br>
0.30000000000000004<br>
<br>
This is fine, I was expecting that. However, why the following works:<br>
<br>
2> 0.1.<br>
0.1<br>
<br>
Is it because of some rounding behaviour?<br>
<br>
<br>
Thanks!<br>
Camille<br>
<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div><br></div>