Erlang Language Data Types Numbers

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

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


Got any Erlang Language Question?