Skip to content

Math functions

Inferno edited this page Mar 13, 2022 · 5 revisions

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.

Examples:

  1. [ADD 1 1] -> 2
  2. [SUB 5 1] -> 4
  3. [DIV 9 3] -> 3

woah math

abs

Returns the absolute value of a number. Ex. [ABS 24] -> 24, [ABS -1289718237] -> 1289718237

add

Adds 2 or more numbers together. Ex. [ADD 1 4] -> 5, [ADD 1 1 1 1 1] -> 5

ceil

Rounds an argument to the next highest whole number. Ex. [CEIL 0.1] -> 1, [CEIL -5.723]-> -5

div

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

floor

Rounds an argument to the next lowest whole number. Ex. [FLOOR 0.1] -> 0, [FLOOR -5.723]-> -6

mod

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

mul

Multiplies 2 or more numbers together. Ex. [MUL 4 4] -> 16, [MUL 111111 12345] -> 1371665295

pow

Raises your first argument to the power of the following arguments. Ex. [POW 4 2]-> 16, [POW 4 2 2]-> 256

round

Rounds a number to the nearest whole number. Ex. [ROUND 0.1] -> 0, [ROUND -5.723]-> -6

sub

Subtracts 2 or more numbers. Ex. [SUB 5 10]-> -5, [SUB 5 -10]-> 15

Clone this wiki locally