-
Notifications
You must be signed in to change notification settings - Fork 4
Math functions
These are the functions that have a relation to math (woah). In other words, these functions will take numbers in as input, and perform mathematical operations on these numbers, and output the result.
-
[ADD 1 1]
->2
-
[SUB 5 1]
->4
-
[DIV 9 3]
->3
woah math
Returns the absolute value of a number.
Ex. [ABS 24]
-> 24
, [ABS -1289718237]
-> 1289718237
Adds 2 or more numbers together.
Ex. [ADD 1 4]
-> 5
, [ADD 1 1 1 1 1]
-> 5
Rounds an argument to the next highest whole number.
Ex. [CEIL 0.1]
-> 1
, [CEIL -5.723]
-> -5
Divides 2 or more numbers together. (Don't put 0 as the second argument.)
Ex. [DIV 1 3]
-> 0.3333333333333333
, [DIV 8 -4 3]
-> -0.6666666666666666
Rounds an argument to the next lowest whole number.
Ex. [FLOOR 0.1]
-> 0
, [FLOOR -5.723]
-> -6
Takes 2 or more arguments, to get the remainder of a division operation.
If there are more than 2 arguments provided, the modulation is done from left to right.
Ex. [MOD 4 17]
-> 4
, [MOD 10 4 3]
-> 2
Multiplies 2 or more numbers together.
Ex. [MUL 4 4]
-> 16
, [MUL 111111 12345]
-> 1371665295
Raises your first argument to the power of the following arguments.
Ex. [POW 4 2]
-> 16
, [POW 4 2 2]
-> 256
Rounds a number to the nearest whole number.
Ex. [ROUND 0.1]
-> 0
, [ROUND -5.723]
-> -6
Subtracts 2 or more numbers.
Ex. [SUB 5 10]
-> -5
, [SUB 5 -10]
-> 15
Numbers n' Vars || Arrays || Strings || Control flow || Meta || # || How do I start?