Skip to content

Category Mathematical Functions

Paul Squires edited this page Oct 19, 2026 · 2 revisions

Home › All Categories › Mathematical Functions

Mathematical Functions

Grouped by task. Numbers and math lists them beside the rest of the area.

Round a number

Function What it does From
Int Returns the largest whole number not above the value, so Int(-1.3) is -2. built-in
Fix Returns the whole-number part, rounding towards zero, so Fix(-4.9) is -4. built-in
Frac Returns the fractional part, keeping the sign, so Frac(-1.75) is -0.75. built-in

Absolute value, sign, smaller and larger

Function What it does From
Abs Returns the absolute value of a number. built-in
Sgn Returns -1, 0 or 1 for the sign of a number, in the number's own type. built-in

Powers, roots and logarithms

Function What it does From
Sqr Returns the square root of a number. built-in
Exp Returns e raised to a power. built-in
Log Returns the natural logarithm; zero gives minus infinity and a negative gives NaN. built-in

Trigonometry and angles

Function What it does From
Sin Returns the sine of an angle in radians. built-in
Cos Returns the cosine of an angle in radians. built-in
Tan Returns the tangent of an angle in radians. built-in
Asin Returns the angle in radians, from -pi/2 to pi/2, whose sine is the number. built-in
Acos Returns the angle in radians, from 0 to pi, whose cosine is the number. built-in
Atn Returns the angle in radians, from -pi/2 to pi/2, whose tangent is the number. built-in
Atan2 Returns the angle in radians, from -pi to pi, of the point at x, y. built-in

Random numbers

Function What it does From
Rnd Returns a random Double from 0 up to but not including 1. built-in
Randomize Seeds the random number generator that Rnd uses, and can choose its algorithm. built-in

Also in this category


Home · Keyword Index

Clone this wiki locally