| Home | | | Quick start | | | Cookbook | | | All symbols | | | Analytical index | | | Namespaces | | | Syntax | | | Statements | | | CX | | | Frequency | | | Functions | | | Examples | | | Examples by command |
Arbitrary precision numeric operations.
Symbols in this namespace: 49
| Symbol | Kind | Category | Description |
|---|---|---|---|
AP.ABS | Command | Arbitrary precision statements | Absolute value. |
AP.ADD | Command | Arbitrary precision statements | Adds AP operands and stores the result. |
AP.CBRT | Command | Arbitrary precision statements | Computes the cube root. |
AP.CEIL | Command | Arbitrary precision statements | Ceiling of an AP value. |
AP.CLEAR | Command | Arbitrary precision statements | Deletes all AP variables from the current runtime. |
AP.COMPARE | Function | Arbitrary precision functions | Compares two AP variables or literals. Returns -1, 0 or +1. |
AP.COPY | Command | Arbitrary precision statements | Copies an AP variable or numeric literal into another AP variable. |
AP.COS | Command | Arbitrary precision statements | Computes cosine. |
AP.COUNT | Function | Arbitrary precision functions | Returns how many AP variables are currently stored. |
AP.DELETE | Command | Arbitrary precision statements | Deletes one AP variable. |
AP.DIGITS | Function | Arbitrary precision functions | Returns the number of significant digits currently stored in the AP value. |
AP.DIV | Command | Arbitrary precision statements | Divides a by b using the given digit precision, or the current AP.PRECISION setting. |
AP.DOUBLE | Function | Arbitrary precision functions | Converts an AP value to a normal Basic double. This is an explicit lossy bridge back to ordinary expressions. |
AP.E | Command | Arbitrary precision statements | Stores Euler's number into an AP variable. |
AP.EVAL | Command | Arbitrary precision statements | Evaluates a compact arbitrary-precision expression inside the AP world. Supports AP variables, numeric literals, pi/e, + - * / ^, parentheses and functions such as sqrt, sin, cos, log, exp, pow, fact, gcd, mod. AP.LET is the friendly alias. |
AP.EXISTS | Function | Arbitrary precision functions | Returns TRUE if an AP variable exists. |
AP.EXP | Command | Arbitrary precision statements | Computes e^a. |
AP.EXPONENT | Function | Arbitrary precision functions | Returns the MAPM decimal exponent of the AP value. |
AP.FACT | Command | Arbitrary precision statements | Computes factorial for integer AP values. AP.FACTORIAL is the long alias. |
AP.FACTORIAL | Command | Arbitrary precision statements | Long alias of AP.FACT. |
AP.FIXED | Function | Arbitrary precision functions | Returns an AP value as fixed-point decimal text. |
AP.FLOOR | Command | Arbitrary precision statements | Floor of an AP value. |
AP.GCD | Command | Arbitrary precision statements | Greatest common divisor for integer AP values. |
AP.IDIV | Command | Arbitrary precision statements | Integer division quotient. |
AP.INTSTR | Function | Arbitrary precision functions | Returns the integer part as a string. |
AP.IPOW | Command | Arbitrary precision statements | Computes an integer exponent power. Useful for exact or near-exact high-precision power series tests. |
AP.LCM | Command | Arbitrary precision statements | Least common multiple for integer AP values. |
AP.LET | Command | Arbitrary precision statements | Alias of AP.EVAL, useful when the AP expression reads like an assignment into the AP variable table. |
AP.LOG | Command | Arbitrary precision statements | Computes the natural logarithm. |
AP.LOG10 | Command | Arbitrary precision statements | Computes the base-10 logarithm. |
AP.MOD | Command | Arbitrary precision statements | Integer remainder. |
AP.MUL | Command | Arbitrary precision statements | Multiplies AP operands and stores the result. |
AP.NEG | Command | Arbitrary precision statements | Changes sign of an AP value. |
AP.PI | Command | Arbitrary precision statements | Stores pi into an AP variable. |
AP.POW | Command | Arbitrary precision statements | Computes a raised to b with arbitrary precision. |
AP.PRECISION | Command | Arbitrary precision statements | Sets the global decimal digit precision used by AP arithmetic. AP variables live in a separate namespace and are not normal Basic numeric variables. |
AP.PRECISION_VALUE | Function | Arbitrary precision functions | Returns the current AP precision setting. |
AP.PROD | Command | Arbitrary precision statements | Evaluates an AP expression repeatedly while index is an AP integer variable, accumulating the product. |
AP.RANDOM | Command | Arbitrary precision statements | Stores a MAPM random value in [0,1). |
AP.ROUND | Command | Arbitrary precision statements | Rounds an AP value. |
AP.SET | Command | Arbitrary precision statements | Creates or replaces an arbitrary-precision variable. Prefer quoted numeric strings for exact decimal input; numeric Basic values already have double precision. |
AP.SIGN | Function | Arbitrary precision functions | Returns -1, 0 or +1 depending on the AP value sign. |
AP.SIN | Command | Arbitrary precision statements | Computes sine. |
AP.SQRT | Command | Arbitrary precision statements | Computes the square root. |
AP.STR | Function | Arbitrary precision functions | Returns an AP value as a string. In expressions, pass the AP variable name as a string, for example AP.STR("c", 80). |
AP.SUB | Command | Arbitrary precision statements | Subtracts b from a and stores the result. |
AP.SUM | Command | Arbitrary precision statements | Evaluates an AP expression repeatedly while index is an AP integer variable, accumulating the sum. The previous index variable is restored after the loop. |
AP.TAN | Command | Arbitrary precision statements | Computes tangent. |
AP.VERSION | Function | Arbitrary precision functions | Returns the underlying MAPM library version. |
AP.ABS dst, a
Absolute value.
AP.ABS aa, aAP.ADD dst, a, b
Adds AP operands and stores the result.
AP.ADD c, a, bAP.CBRT dst, a [, digits]
Computes the cube root.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
digits | Optional parameter. If omitted, the command uses its internal default. |
AP.CBRT r3, "3", 100AP.CEIL dst, a
Ceiling of an AP value.
AP.CEIL c, xAP.CLEAR
Deletes all AP variables from the current runtime.
AP.CLEARAP.COMPARE(a, b)
Compares two AP variables or literals. Returns -1, 0 or +1.
cmp = AP.COMPARE("a", "b")AP.COPY dst, src
Copies an AP variable or numeric literal into another AP variable.
AP.COPY backup, resultAP.COS dst, a [, digits]
Computes cosine.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
digits | Optional parameter. If omitted, the command uses its internal default. |
AP.COS c, pi, 120AP.COUNT()
Returns how many AP variables are currently stored.
PRINT AP.COUNT()AP.DELETE name
Deletes one AP variable.
AP.DELETE tmpAP.DIGITS(name)
Returns the number of significant digits currently stored in the AP value.
PRINT AP.DIGITS("x")AP.DIV dst, a, b [, digits]
Divides a by b using the given digit precision, or the current AP.PRECISION setting.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
digits | Optional parameter. If omitted, the command uses its internal default. |
AP.DIV q, one, seven, 120AP.DOUBLE(name)
Converts an AP value to a normal Basic double. This is an explicit lossy bridge back to ordinary expressions.
x = AP.DOUBLE("result")AP.E dst
Stores Euler's number into an AP variable.
AP.E eAP.EVAL dst, "expression"
Evaluates a compact arbitrary-precision expression inside the AP world. Supports AP variables, numeric literals, pi/e, + - * / ^, parentheses and functions such as sqrt, sin, cos, log, exp, pow, fact, gcd, mod. AP.LET is the friendly alias.
AP.EVAL y, "sin(pi/7)^2 + cos(pi/7)^2"
PRINT AP.STR("y", 100)AP.EXISTS(name)
Returns TRUE if an AP variable exists.
IF AP.EXISTS("c") THEN PRINT AP.STR("c")AP.EXP dst, a [, digits]
Computes e^a.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
digits | Optional parameter. If omitted, the command uses its internal default. |
AP.EXP ex, x, 100AP.EXPONENT(name)
Returns the MAPM decimal exponent of the AP value.
PRINT AP.EXPONENT("x")AP.FACT dst, a
Computes factorial for integer AP values. AP.FACTORIAL is the long alias.
AP.FACT f100, "100"AP.FACTORIAL dst, a
Long alias of AP.FACT.
AP.FACTORIAL f100, "100"AP.FIXED(name [, decimals])
Returns an AP value as fixed-point decimal text.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
decimals | Optional parameter. If omitted, the command uses its internal default. |
PRINT AP.FIXED("pi", 80)AP.FLOOR dst, a
Floor of an AP value.
AP.FLOOR f, xAP.GCD dst, a, b
Greatest common divisor for integer AP values.
AP.GCD g, a, bAP.IDIV dst, a, b
Integer division quotient.
AP.IDIV q, a, bAP.INTSTR(name)
Returns the integer part as a string.
PRINT AP.INTSTR("f100")AP.IPOW dst, a, integerExponent [, digits]
Computes an integer exponent power. Useful for exact or near-exact high-precision power series tests.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
digits | Optional parameter. If omitted, the command uses its internal default. |
AP.IPOW p, x, 12AP.LCM dst, a, b
Least common multiple for integer AP values.
AP.LCM l, a, bAP.LET dst, "expression"
Alias of AP.EVAL, useful when the AP expression reads like an assignment into the AP variable table.
AP.LET r, "(sqrt(2)+sqrt(3))^2"AP.LOG dst, a [, digits]
Computes the natural logarithm.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
digits | Optional parameter. If omitted, the command uses its internal default. |
AP.LOG lx, x, 100AP.LOG10 dst, a [, digits]
Computes the base-10 logarithm.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
digits | Optional parameter. If omitted, the command uses its internal default. |
AP.LOG10 l10, x, 100AP.MOD dst, a, b
Integer remainder.
AP.MOD r, a, bAP.MUL dst, a, b
Multiplies AP operands and stores the result.
AP.MUL p, a, bAP.NEG dst, a
Changes sign of an AP value.
AP.NEG n, aAP.PI dst
Stores pi into an AP variable.
AP.PI piAP.POW dst, a, b [, digits]
Computes a raised to b with arbitrary precision.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
digits | Optional parameter. If omitted, the command uses its internal default. |
AP.POW y, x, "0.5", 100AP.PRECISION digits
Sets the global decimal digit precision used by AP arithmetic. AP variables live in a separate namespace and are not normal Basic numeric variables.
AP.PRECISION 120AP.PRECISION_VALUE()
Returns the current AP precision setting.
PRINT AP.PRECISION_VALUE()AP.PROD dst, index, start, end, "expression" [, step]
Evaluates an AP expression repeatedly while index is an AP integer variable, accumulating the product.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
step | Optional parameter. If omitted, the command uses its internal default. |
AP.PROD p, k, 1, 20, "1 + 1 / k^2"
PRINT AP.STR("p", 80)AP.RANDOM dst
Stores a MAPM random value in [0,1).
AP.RANDOM rndAP.ROUND dst, a, digits
Rounds an AP value.
AP.ROUND r, pi, 40AP.SET name, value
Creates or replaces an arbitrary-precision variable. Prefer quoted numeric strings for exact decimal input; numeric Basic values already have double precision.
AP.SET a, "0.1"
AP.SET b, "0.2"AP.SIGN(name)
Returns -1, 0 or +1 depending on the AP value sign.
PRINT AP.SIGN("x")AP.SIN dst, a [, digits]
Computes sine.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
digits | Optional parameter. If omitted, the command uses its internal default. |
AP.SIN s, pi, 120AP.SQRT dst, a [, digits]
Computes the square root.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
digits | Optional parameter. If omitted, the command uses its internal default. |
AP.SQRT r2, "2", 120AP.STR(name [, digits])
Returns an AP value as a string. In expressions, pass the AP variable name as a string, for example AP.STR("c", 80).
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
digits | Optional parameter. If omitted, the command uses its internal default. |
PRINT AP.STR("c", 80)AP.SUB dst, a, b
Subtracts b from a and stores the result.
AP.SUB d, a, bAP.SUM dst, index, start, end, "expression" [, step]
Evaluates an AP expression repeatedly while index is an AP integer variable, accumulating the sum. The previous index variable is restored after the loop.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
step | Optional parameter. If omitted, the command uses its internal default. |
AP.PRECISION 120
AP.SUM eApprox, k, 0, 80, "1 / fact(k)"
PRINT AP.STR("eApprox", 100)AP.TAN dst, a [, digits]
Computes tangent.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
digits | Optional parameter. If omitted, the command uses its internal default. |
AP.TAN t, angle, 100AP.VERSION()
Returns the underlying MAPM library version.
PRINT AP.VERSION()