Wizard.Math

Wizard’s Mathemagic functions

Summary

combination(n, k)

combination(n, k) - produces n choose k

e()

Euler’s number (lel)

factorial(n)

factorial(n) - produces n!

gcd(a, b)

Produces the greatest common divsor (GCD) of a and b TODO: fix negative arguments

log(b \\ e(), n)

log(b, n) - produces log_b n with default base of e

nth_root(a, n)

nth_root(a, n) - produces the nth root of a

permutation(n, k)

permutation(n, k) - produces k-permutations of n

pi()

Pi (lel)

pow(x, y)

pow(x, y) - produces x to the yth power TODO: fix decimal to fraction conversion the current version creates massive runtimes

sqrt(n)

sqrt(n) - produces the square root of n

  • wraps the sqrt(s,n,x) function for cleaner use
sum(list)

sum(list) - produces the sum of all the elements in a list

Functions

combination(n, k)

Specs:

  • combination(non_neg_integer, non_neg_integer) :: non_neg_integer

combination(n, k) - produces n choose k

e()

Euler’s number (lel)

factorial(n)

Specs:

  • factorial(non_neg_integer) :: non_neg_integer

factorial(n) - produces n!

gcd(a, b)

Specs:

  • gcd(integer, integer) :: integer

Produces the greatest common divsor (GCD) of a and b TODO: fix negative arguments

log(b \\ e(), n)

Specs:

  • log(number, number) :: number

log(b, n) - produces log_b n with default base of e

nth_root(a, n)

Specs:

  • nth_root(number, non_neg_integer) :: number

nth_root(a, n) - produces the nth root of a

permutation(n, k)

Specs:

  • permutation(non_neg_integer, non_neg_integer) :: non_neg_integer

permutation(n, k) - produces k-permutations of n

pi()

Pi (lel)

pow(x, y)

Specs:

  • pow(number, integer) :: number

pow(x, y) - produces x to the yth power TODO: fix decimal to fraction conversion the current version creates massive runtimes

sqrt(n)

Specs:

  • sqrt(number) :: number

sqrt(n) - produces the square root of n

  • wraps the sqrt(s,n,x) function for cleaner use
sum(list)

Specs:

  • sum(list) :: number

sum(list) - produces the sum of all the elements in a list