ElixirMath v0.1.1 ElixirMath View Source
Math library for Elixir.
Link to this section Summary
Functions
Returns the arccosine of a number
Returns the hyperbolic arccosine of a number
Returns the arc sine of a number
Returns the hyperbolic arc sine of a number
Returns the arc tangent of a number
Returns the tangent inverse of y / x, where y is the proportion of the y coordinate and x is the proportion of the x coordinate
Returns the hyperbolic arc tangent of a number
Returns smallest number greater than or equal to the given number
Returns the cosine of given angle
Returns the hyperbolic cosine of given number
Returns the error function of x
Returns 1.0 - erf(x), computed by methods that void cancellation for large x
Returns returns e^x, where x is the argument, and e is Euler’s number
Returns the largest integer less than or equal to a given number
Returns the remainder when x is divided by y
Returns the greatest common divisor of a set of numbers
Returns true if a number is prime
Returns the least common multiple of a set of numbers
Returns the logarithm of a number
Returns the base 10 logarithm of a number
Returns the base 2 logarithm of a number
Returns PI
Returns the base to the exponent power
Returns a list of prime numbers
Returns the sine of a number
Returns the hyperbolic sine of a number
Returns the square root of a number
Returns the tangent of a number
Returns the hyperbolic tangent of a number
Link to this section Functions
Returns the tangent inverse of y / x, where y is the proportion of the y coordinate and x is the proportion of the x coordinate.
Examples
iex> ElixirMath.atan2(10, 15)
0.5880026035475675
Returns the hyperbolic arc tangent of a number.
Examples
iex> ElixirMath.atanh(0.5)
0.5493061443340549
Returns smallest number greater than or equal to the given number.
Examples
iex> ElixirMath.ceil(0.5)
1.0
Returns the hyperbolic cosine of given number.
Examples
iex> ElixirMath.cosh(0.45)
1.102970168555971
Returns 1.0 - erf(x), computed by methods that void cancellation for large x.
Examples
iex> ElixirMath.erfc(0.2) 0.7772974107895215
Returns returns e^x, where x is the argument, and e is Euler’s number.
Examples
iex> ElixirMath.exp(15)
3269017.3724721107
Returns the largest integer less than or equal to a given number.
Examples
iex> ElixirMath.floor(15.2) 15.0
Returns the greatest common divisor of a set of numbers.
Example
iex> ElixirMath.gcd(90, 9)
9
iex> ElixirMath.gcd(9, 90)
9
Returns true if a number is prime.
Examples
iex> ElixirMath.is_prime(3)
true
iex> ElixirMath.is_prime(10)
false
Returns the least common multiple of a set of numbers.
Examples
iex> ElixirMath.lcm(90, 9)
90
iex> ElixirMath.lcm(9, 90)
90
Returns a list of prime numbers.
Examples
iex> ElixirMath.prime_numbers(10)
[2, 3, 5, 7, 11, 13, 17, 19, 23, 29]