Skip to main content

math.Math#

The full JavaScript Math global plus the standard numeric globals are available inside scripts as the platform sandbox exposes them.

SYNTAX#

Math.abs, Math.sqrt, Math.max, Math.min, Math.log, Math.exp, Math.pow, Math.round, Math.floor, Math.ceil, Math.PI, Math.E, isNaN, isFinite, parseInt, parseFloat, NaN, Infinity

RETURNS#

Standard JavaScript numeric utilities (no Rigor-side wrapper).

REMARKS#

These are the standard JavaScript identifiers — they live on the script's global scope, not under the math.* Rigor namespace. The math.* Rigor helpers (clamp, lerp, percentile, round) are documented separately and complement (do not shadow) the global Math.

EXAMPLE#

const tr  = Math.max(
  candles[i].high - candles[i].low,
  Math.abs(candles[i].high - candles[i-1].close),
  Math.abs(candles[i].low  - candles[i-1].close)
);
const stddev = Math.sqrt(variance / period);
if (isNaN(values[i])) values[i] = 0;

SEE ALSO#

math.clamp, math.round