The value types in Elixir represent numbers, names, ranges, and regular expressions.

Integer literals can be written as decimal (1234), hexadecimal (0xcafe), octal (0o765), and binary (0b1010).

Decimal numbers may contain underscores—these are often used to separate groups of three digits when writing large numbers, so one million could be written 1_000_000.

There is no fixed limit on the size of integers—their internal representation grows to fit their magnitude.

| factorial(10000) # => 28462596809170545189...and so on for 35640 more digits... |

(You’ll see how to write a function such as factorial in Modules and Named Functions,.)

Floating-point numbers are written using a decimal point. There must ...

Start Free Trial

No credit card required