3.2  Number

3.2 Number

There are two types of numeric literals, integers and floats. Besides the conventional notation, there are two Erlang-specific notations:

  • $char ASCII value or unicode code-point of the character char.
  • base #value Integer with the base base , that must be an integer in the range 2..36.Examples:
1> 42.
42
2> $A.
65
3> $\n.
10
4> 2#101.
5
5> 16#1f.
31
6> 2.3.
2.3
7> 2.3e3.
2.3e3
8> 2.3e-3.
0.0023