Abs(value) : Float

Returns the absolute value of a number.

Abs Parameters

value : Float?

Abs Examples

var ok = Abs(10) == 10;
var ok = Abs(-10.5) == 10.5;
var ok = Abs(-10d) == 10d;
var ok = Abs(-10.5$) == 10.5$;
var ok = Abs(null) == null;

Atan2(y, x) : Float

Returns the angle whose tangent is the quotient of two specified numbers.

That is an angle, θ, measured in radians, such that -π ≤ θ ≤ π, and tan(θ) = y / x, where (x, y) is a point in the Cartesian plane. Observe the following: For (x, y) in quadrant 1, 0 < θ < π/2. For (x, y) in quadrant 2, π/2 < θ ≤ π. For (x, y) in quadrant 3, -π < θ < -π/2. For (x, y) in quadrant 4, -π/2 < θ < 0. For points on the boundaries of the quadrants, the return value is the following: If y is 0 and x is not negative, θ = 0. If y is 0 and x is negative, θ = π. If y is positive and x is 0, θ = π/2.

Atan2 Parameters

y : Float?
The y coordinate of a point.

x : Float?
The x coordinate of a point.

Avg(array, itemSelector?) : Float

Returns the numeric average of array items.

Avg Parameters

array : []?

itemSelector? : Function

Avg Examples

var ok = Avg([10, 20, 30, 40]) == 25;

Ceil(value) : Float

Returns the smallest integral value that is greater than or equal to the specified floating-point number.

Ceil Parameters

value : Float?

Ceil Examples

var ok = Ceil(10.1) == 11;
var ok = Ceil(-10.1) == -10;
var ok = Ceil(-10.1d) == -10d;
var ok = Ceil(-10.1$) == -10$;
var ok = Ceil(null) == null;

Cos(angle) : Float

Returns the cosine of the specified angle measured in radians.

Cos Parameters

angle : Float?

Cos Examples

var ok = Cos(0) == 1;
var ok = Cos(Pi()) == -1;

Exp(power) : Float

Returns e raised to the specified power.

Exp Parameters

power : Float?

Exp Examples

var ok = Exp(0) == 1;
var ok = Exp(Ln(4)) == 4;

Floor(value) : Float

Returns the largest integer less than or equal to the specified floating-point number.

Floor Parameters

value : Float?

Floor Examples

var ok = Floor(10.9) == 10;
var ok = Floor(-10.9) == -11;
var ok = Floor(-10.9d) == -11d;
var ok = Floor(-10.9$) == -11$;
var ok = Floor(null) == null;

Lg(value) : Float

Returns the base 10 logarithm of a specified number.

Lg Parameters

value : Float?

Lg Examples

var ok = Lg(1) == 0;
var ok = Lg(10) == 1;
var ok = Lg(100) == 2;
var ok = Lg(0.1) == -1;

Ln(value) : Float

Returns the natural (base e) logarithm of a specified number.

Ln Parameters

value : Float?

Ln Examples

var ok = Ln(1) == 0;
var ok = Ln(Exp(4)) == 4;

Max(arrayOrValue1, itemSelectorOrValue2?, …)

Returns maximum numeric value from array or from arguments.

Max Parameters

arrayOrValue1 : ?

itemSelectorOrValue2? : ?

? : ?

Max Examples

var ok = Max([1, 2, 3]) == 3;
var ok = Max(1, 2, 3) == 3;
var ok = [{A=1}, {A=2}, {A=3}].Max(o => o.A) == 3;

Min(arrayOrValue1, itemSelectorOrValue2?, …)

Returns minimum numeric value from array or from arguments.

Min Parameters

arrayOrValue1 : ?

itemSelectorOrValue2? : ?

? : ?

Min Examples

var ok = Min([1, 2, 3]) == 1;
var ok = Min(1, 2, 3) == 1;
var ok = [{A=1}, {A=2}, {A=3}].Min(o => o.A) == 1;

Mod(dividend, divisor) : Float

Returns remainder (always non-negative) resulting from the division of a specified number by another specified number.

Mod Parameters

dividend : Float?

divisor : Float

Mod Examples

var ok = Mod(4, 2) == 0;
var ok = Mod(4, 3) == 1;
var ok = Mod(-4, 3) == 2;
var ok = Mod(null, 3) == null;

Pi() : Float

Constant π.

Pi Examples

var ok = Pi() == 3.1415926535897931;

Pow(value, power) : Float

Returns a specified number raised to the specified power.

Pow Parameters

value : Float

power : Float

Pow Examples

var ok = Pow(2, 4) == 16;
var ok = Pow(2, -4) == 0.0625;
var ok = Pow(-2, 4) == 16;
var ok = Pow(-2, 3) == -8;

Random(minOrMax?, max?) : Integer

If no arguments, returns non-negative random number.
If one argument, returns non-negative random number less than the specified maximum.
If two arguments, returns random number within a specified range [min, max).

Random Parameters

minOrMax? : Integer

max? : Integer

Round(value, digits = 0, midPointToEven = false) : Float

Returns a floating-point value rounded to a specified number of fractional digits.

Round Parameters

value : Float?

digits : Integer = 0

midPointToEven : Boolean = false
If true, and the value is halfway between two others, it is rounded toward the nearest even number.

Round Examples

var ok = Round(2.5) == 3;
var ok = Round(-3.5) == -4;
var ok = Round(2.5, 0, true) == 2;

Sin(angle) : Float

Returns the sine of the specified angle measured in radians.

Sin Parameters

angle : Float?

Sin Examples

var ok = Sin(0) == 0;
var ok = Sin(Pi()/2) == 1;

Sqrt(value) : Float

Returns square root of a specified number.

Sqrt Parameters

value : Float?

Sqrt Examples

var ok = Sqrt(0) == 0;
var ok = Sqrt(4) == 2;

Sum(array, itemSelector?)

Calculates the numeric sum of array items.

Sum Parameters

array : []?

itemSelector? : Function
Can be dict for value lookup.

Sum Examples

var ok = Sum([1, 2, 3, 4]) == 10;
var ok = [{A=1}, {A=2}, {A=3}, {A=4}].Sum(o => o.A) == 10;

Tan(angle) : Float

Returns tangent of the specified angle measured in radians.

Tan Parameters

angle : Float?

Tan Examples

var ok = Tan(0) == 0;
var ok = Tan(Pi()) == 0;

ToBoolean(value) : Boolean

Converts value to boolean.

The following values are converted to false:

  • null, missing, false;
  • empty string, ‘0’, ‘false’;
  • zero numbers;
  • Date(1, 1, 1), Time(0, 0, 0), Duration(0);
  • empty url, empty array, empty dict.
All other values are converted to true.

ToBoolean Parameters

value : ?

ToBoolean Examples

var ok = ToBoolean('') == false;
var ok = ToBoolean(0) == false;
var ok = ToBoolean([]) == false;
var ok = ToBoolean({}) == false;
var ok = ToBoolean('text') == true;
var ok = ToBoolean(-1) == true;
var ok = ToBoolean([0]) == true;
var ok = ToBoolean({A=0}) == true;

ToDecimal(value) : Decimal

Converts value to decimal number.

ToDecimal Parameters

value : ?

ToDecimal Examples

var ok = ToDecimal(10) == 10d;

ToFloat(value) : Float

Converts value to floating-point number.

ToFloat Parameters

value : ?

ToFloat Examples

var ok = ToFloat(10) == 10.0;

ToInteger(value) : Integer

Converts value to integer number.

ToInteger Parameters

value : ?

ToInteger Examples

var ok = ToInteger(10.5) == 10;

ToLong(value) : Long

Converts value to long integer number.

ToLong Parameters

value : ?

ToMoney(value) : Money

Converts value to money (decimal number).

ToMoney Parameters

value : ?

ToMoney Examples

var ok = ToMoney(10) == 10$;

Trunc(value) : Float

Returns the integral part of a specified floating-point number.

Trunc Parameters

value : Float?

Trunc Examples

var ok = Trunc(10.9) == 10.0;
var ok = Trunc(-10.9) == -10.0;
var ok = Trunc(-10.9d) == -10.0d;
var ok = Trunc(-10.9$) == -10.0$;
var ok = Trunc(null) == null;

Leave a Comment

Your email address will not be published. Required fields are marked *