• Mathematical Functions

  • _Abs(number)

    • Purpose: Returns the absolute value of a number (i.e., its distance from zero).

    • Syntax: __Abs(-10) // Returns 10

  • _Atn(number)

    • Purpose: Returns the arctangent of a number (in radians).

    • Syntax: __Atn(1) // Returns approximately 0.7854 (roughly pi/4)

  • _Cos(number)

    • Purpose: Returns the cosine of an angle (provided in radians).

    • Syntax: __Cos(0) // Returns 1

  • _Exp(number)

    • Purpose: Calculates e (the base of natural logarithms) raised to the power of a number.

    • Syntax: _Exp(1) // Returns approximately 2.718

  • _Int(number)

    • Purpose: Returns the integer portion of a number (truncates the decimal part)

    • Syntax: __Int(3.14) // Returns 3

  • _Log(number)

    • Purpose: Calculates the natural logarithm (base e) of a number.

    • Syntax: __Log(2.718) // Returns approximately 1

  • _Rnd()

    • Purpose: Generates a random number between 0 and 1.

    • Syntax: __Rnd()

  • _Sgn(number)

    • Purpose: Returns the sign of a number: 1 for positive, -1 for negative, 0 for zero.

    • Syntax: __Sgn(-5) // Returns -1

  • _Sin(number)

    • Purpose: Returns the sine of an angle (provided in radians).

    • Syntax: __Sin(0) // Returns 0

  • _Sqr(number)

    • Purpose: Calculates the square root of a number.

    • Syntax: __Sqr(9) // Returns 3

  • _Tan(number)

    • Purpose: Returns the tangent of an angle (provided in radians).

    • Syntax: __Tan(0) // Returns 0

    Formatting and Conversion

  • _Convert_To_Any_Base(number_string, base)

    • Purpose: Converts a number represented as a string to a different number base (e.g., from decimal to binary).

    • Syntax: __Convert_To_Any_Base("11", 2) // Returns "1011" (binary)

  • _Format(number, format)

    • Purpose: Formats a number according to a formatting string.

    • Syntax: __Format(12345.678, "#,##0.00") // Returns "12,345.68"

  • _Hex(number)

    • Purpose: Converts a decimal number to hexadecimal representation.

    • Syntax: __Hex(255) // Returns "FF"

  • _Oct(number)

    • Purpose: Converts a decimal number to octal representation.

    • Syntax: __Oct(9) // Returns "11"

  • _Str(number)

    • Purpose: Converts a number into its string representation.

    • Syntax: __Str(123.45) // Returns "123.45"

  • _Val(string)

    • Purpose: Converts the beginning of a string into a numeric value.

    • Syntax: __Val("123abc") // Returns 123