Elixir Notes: Types
29th January 2021
Elixir has a number of types similar to most programming languages.
Integers are whole numbers.
# Integers 1 42 100 9001
Floats are decimal place numbers.
# Floats 1.42 9000.1
Booleans are true or false values.
# Booleans true false
Atoms are constants where the value is the same as the name of the atom. Atoms are similar to symbols in Ruby and are defined with a colon :.
# Define an atom :stuff
true, false and nil are also atoms, but they do not need to be prefixed with a colon.
String are defined by enclosing characters in double quotes "" and are encoded in UTF-8.
# Define a string stuff = "stuff"