[erlang-questions] Erlang Numbers

Camille Troillard <>
Tue Jun 17 18:21:23 CEST 2014


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




More information about the erlang-questions mailing list