Skip to main content
These functions adjust or inspect a number’s value. Each accepts a number or a table, returning the same shape.
Round only when you mean to change the value. TrueMath carries values at full precision through every step. round, floor, and ceil permanently discard that precision, and a rounded value used in a later calculation introduces error that compounds across steps. They also change the value an activity returns, which can make it impossible to solve in reverse.To show fewer decimals without losing precision, set the variable’s display format instead of rounding.

Round [round]

Rounds to places following standard rounding (digits 0–4 round down, 5–9 round up). Set places to 110 to round to that decimal place, or 0 to -10 to round to a whole-number place; it defaults to 0. places must be a whole number in the range -10 to 10 (real numbers are truncated); outside that range returns a Parameter out of range error.

Floor [floor]

The largest value less than or equal to value at the given places. places follows the same rules as round.

Ceiling [ceil]

The smallest value greater than or equal to value at the given places. places follows the same rules as round.

Absolute value [abs]

The absolute (non-negative) value.

Sign [sign]

-1 if value is negative, 0 if zero, 1 if positive.

Integer part [ipart]

The integer (whole-number) portion of value.

Fractional part [fpart]

The fractional (decimal) portion of value.