ApasScript.

Big Numbers

bigGcd

The greatest common divisor of a and b, computed via arbitrary-precision integers -- stays exact for magnitudes far beyond ordinary 128-bit arithmetic.

bigPow

base raised to a non-negative integer exponent, computed via arbitrary-precision integers -- stays an exact integer at any magnitude, unlike ordinary exponentiation which falls back to an approximate float once it outgrows native range. Works while the answer has at most 70000 digits. A power written with ^ is exact up to 10000 digits; past that it is refused at once, or a decimal where a decimal can hold it.

floor

The largest whole number <= x, exact at any size.

ceil

The smallest whole number >= x, exact at any size.

round

x rounded to the nearest whole number (halves away from zero), exact at any size. round(x, n) rounds to n decimal places (a negative n to tens, hundreds, ...) and shows the decimal it is: round(2.345, 2) is 2.35, round(1250, -2) is 1300. A list is rounded item by item. Inside a rule or any expression it is the calculator's own, so g(x) = round(x/3, 1) works too.

root

The real n-th root of x, exact when x is a perfect n-th power: root(32, 5) is 2, root(-8, 3) is -2 (an odd root of a negative is negative), root(1/32, 5) is 1/2, root(8, 2) is 2sqrt(2). Any other x gives the exact root in simplest form: root(54, 3) is 3cbrt(2), the same number as 54^(1/3) (a number written with a decimal point, root(2.7, 3), gives the decimal). n is a whole number of at least 1; an even root of a negative number is not real and is refused.

trunc

x with its fractional part dropped (towards zero).

frac

The fractional part x - trunc(x).

fracPart

The fractional part {x} = x - floor(x), always in [0, 1): fracPart(7/2) and fracPart(-7/2) are both 1/2, fracPart(-3 + 1/10^9) is 1/10^9, fracPart(5) is 0; frac keeps the sign of x (frac(-7/2) is -1/2). Inside limit it is replaced by its constant value on the side approached: limit(fracPart(x) + fracPart(-x), x, 1, "left") is 1.

numerator

The numerator of x in lowest terms.

denominator

The denominator of x in lowest terms.

isInteger

True if x is a whole number.

mixedFraction

x as a mixed number, e.g. 7/2 is "3 1/2" and -7/2 is "-3 1/2".