# Math Commands (Template Language)

Math commands of Software Ideas Modeler template language.
Command Name Result Type Description
Ceiling(number:Number) Number

Rounds a number up to the nearest whole number.

Parameter: The number to round up.

Example: `Ceiling(2.3)` returns `3`.

Dec(number:Number) Number

Decrements the given number by one.

Parameter: The number to decrement.

Example: `Dec(5)` returns `4`.

Div(...number:Number) Number

Divides the first number by each subsequent number in the parameter list.

Parameters: A sequence of numbers to be divided, starting with the dividend followed by one or more divisors.

Example: `Div(20, 5, 2)` returns `2` (20 divided by 5, then divided by 2).

Floor(number:Number) Number

Rounds a number down to the nearest whole number.

Parameter: The number to round down.

Example: `Floor(2.8)` returns `2`.

Inc(number:Number) Number

Increments the given number by one.

Parameter: The number to increment.

Example: `Inc(4)` returns `5`.

IsNumber(object:Object) Boolean

Checks if the given object is a number.

Parameter: The object to check.

Example: `IsNumber("5")` returns `true`; `IsNumber("A")` returns `false`.

Log(number:Number, newBase:Number) Number

Calculates the logarithm of a number with respect to a base.

Parameters: The number and the base for the logarithm calculation.

Example: `Log(100, 10)` returns `2`.

Max(...number:Number) Number

Returns the maximum value among the given numbers.

Parameters: A comma-separated list of numbers to compare.

Example: `Max(1, 3, 2)` returns `3`.

Min(...number:Number) Number

Returns the minimum value among the given numbers.

Parameters: A comma-separated list of numbers to compare.

Example: `Min(1, 3, 2)` returns `1`.

Mod(number:Number, divisor:Number) Number

Calculates the remainder of the division of the given number by the divisor.

Parameters: The dividend and the divisor.

Example: `Mod(5, 2)` returns `1`.

Mul(...number:Number) Number

Multiplies the given numbers together.

Parameters: A sequence of numbers to multiply.

Example: `Mul(2, 3, 4)` returns `24`.

Pow(x:Number, y:Number) Number

Raises a number to the power of another number.

Parameters: The base number `x` and the exponent `y`.

Example: `Pow(2, 3)` returns `8`.

Round(number:Number, digits:Number) Number

Rounds a number to a specified number of decimal places.

Parameters: The number to round and the number of decimal places to round to.

Example: `Round(2.123, 2)` returns `2.12`.

Sqrt(number:Number) Number

Calculates the square root of a number.

Parameter: The number to find the square root of.

Example: `Sqrt(4)` returns `2`.

Subt(...number:Number) Number

Subtracts each subsequent number from the first number in the parameter list.

Parameters: A sequence of numbers to subtract, starting with the minuend followed by one or more subtrahends.

Example: `Subt(10, 3, 2)` returns `5` (10 minus 3, then minus 2).

Sum(...number:Number) Number

Adds together all the given numbers.

Parameters: A sequence of numbers to add.

Example: `Sum(1, 2, 3)` returns `6`.

Comment