Module Advanced Math

This module contains more advanced mathematical functions and objects.

Functions

  • sin : computes the sin of a number
>> (sin 0)
LI>> 0
>> (sin pi)
LI>> 0.00000000000000012246467991473532
>> (sin (/ pi 2))
LI>> 1
  • cos : computes the cos of a number
>> (cos 0)
LI>> 1
>> (cos pi)
LI>> -1
>> (cos (/ pi 2))
LI>> 0.00000000000000006123233995736766
  • pow : computes a number to a certain power
>> (pow 2 3)
LI>> 8
>> (pow 2 3.5)
LI>> 11.313708498984761
>> (pow 2.3 3.5)
LI>> 18.45216910555504
  • square : computes a number to the square.
>> (square 2)
LI>> 4
>> (square 2.3)
LI>> 5.289999999999999
  • sqrt computes the square root of a number
>> (sqrt 4)
LI>> 2
  • abs: computes the absolute of a number
>> (abs 2)
LI>> 2
>> (abs -2)
LI>> 2
  • rand-int-in-range : generates a random int in a range.
>> (rand-int-in-range 0 10)
LI>> 6
  • rand-float-in-range : generates a random float in a range.
>> (rand-float-in-range 0 10)
LI>> 1.875527591323538

Constants

  • pi: value of constant pi in f64