Erlang Language Numbers


Example

In Erlang, numbers are either integers or floats. Erlang uses arbitrary-precision for integers (bignums), so their values are limited only by the memory size of your system.

1> 11.
11
2> -44.
-44
3> 0.1.
0.1
4> 5.1e-3.
0.0051
5> 5.2e2.
520.0

Numbers can be used in various bases:

1> 2#101.
5
2> 16#ffff.
65535

$-prefix notation yields the integer value of any ASCII/Unicode character:

3> $a.
97
4> $A.
65
5> $2.
50
6> $🤖.
129302