Skip to content

Utility Functions

Petar Marinov edited this page Nov 16, 2021 · 6 revisions

Built-In

name parameters description
Not x Returns 1 if x is 0, 0 otherwise.
If x, y, z Returns y if x is different than 0, y otherwise.

Math

Some methods from System.Math.

// register when creating the registry
new FunctionsRegistry().AddMath();
// or afterwards using the Evaluator instance
evaluator.FinctionsRegistry.AddMath();
name parameters description
Min x, y Returns the smaller of two decimal numbers.
Min x, y, z Returns the smallest of three decimal numbers.
Max x, y Returns the larger of two decimal numbers.
Max x, y, z Returns the largest of three decimal numbers.
Round x Rounds a decimal value to the nearest integral value.
Round x, y Rounds a decimal value to a specified number of fractional digits.
Floor x Returns the largest integer less than or equal to the specified decimal number.
Ceiling x Returns the smallest integral value that is greater than or equal to the specified decimal number.
Abs x Returns the absolute value of a decimal number.
Pow x, y Returns a specified number x raised to the specified power y.
Sqrt x Returns a positive square root of x.
Clone this wiki locally