Skip to main content

Numeric Values

Numbers are either integers or floating point values in Dark Elixir

5, 50.05, -5

Numeric Operations

  • + -> Addition
  • - -> Subtraction
  • * -> Multiplication
  • / -> Division
  • % -> Modulus

Numerical Functions

There are some useful functions we can use from the Numerical Module on the numbers

pow(base, exponent)

Takes in base and exponent of the number and returns the power

> Number.pow(2, 2)
4

floor_div(dividend, divisor)

Performs floor division on the numbers and return the quotient

> Number.floor_div(5, 2)
2