Integer Functions - Gnorion/BizVR GitHub Wiki

Integer Functions

Function Example
+ - * / ** = += -= *= < <= > >= <>
absVal(integer) absval(-42) returns 42
div(integer,divisor) div(42,5) returns 8
gcd(integer,integer) gcd(42,18) returns 6
ln(integer)
isPrime(integer) isPrime(37) returns true
isProbablyPrime(integer)
factorial(integer) factorial(6) returns 720
factors(integer) factors(15) returns {1,3,5}
log(integer)
log(integer,base)
max(integer,integer) max(100,50) returns 100
min(integer,integer) min(100,50) returns 50
mod(integer,modulus) mod(15,4 returns 3
permutationsOf(n,r) permutationsOf(5,3) returns 60 The number of ways to choose a sample of r elements from a set of n distinct objects where order does matter and replacements are not allowed. When n = r this reduces to n!, a simple factorial of n.
circularPermutations(n) circularPermutations(5) returns 24 The number of ways to arrange n distinct objects along a fixed circle
combinationsOf(n,r) combinationsOf(5,3) returns 10 The number of ways to choose a sample of r elements from a set of n distinct objects where order does not matter and replacements are not allowed
random(min,max) returns a random number in the range
toDecimal(integer) toDecimal(27) return 27.0
toString(integer) toSring(27) returns '27'
⚠️ **GitHub.com Fallback** ⚠️