@hyperfrontend/immutable-api-utils/built-in-copy/math

math

Locked, prototype-pollution-resistant copies of the global Math static methods and constants.

References to Math.E, Math.PI, Math.LN2, Math.LN10, Math.LOG2E, Math.LOG10E, Math.SQRT2, Math.SQRT1_2, plus the full set of math functions (abs, floor, ceil, round, sqrt, pow, trig, logarithms, etc.) are captured at module-load time and frozen into a tamper-proof namespace, so numeric computations stay deterministic even if the global Math is later patched. Effective only when imported before any untrusted code has had a chance to mutate the prototype chain.

API Reference

Variables

§type

abs

(Safe copy) Returns the absolute value of a number.
§type

acos

(Safe copy) Returns the arccosine of a number.
§type

acosh

(Safe copy) Returns the inverse hyperbolic cosine of a number.
§type

asin

(Safe copy) Returns the arcsine of a number.
§type

asinh

(Safe copy) Returns the inverse hyperbolic sine of a number.
§type

atan

(Safe copy) Returns the arctangent of a number.
§type

atan2

(Safe copy) Returns the arctangent of the quotient of its arguments.
§type

atanh

(Safe copy) Returns the inverse hyperbolic tangent of a number.
§type

cbrt

(Safe copy) Returns the cube root of a number.
§type

ceil

(Safe copy) Returns the smallest integer greater than or equal to a number.
§type

clz32

(Safe copy) Returns the number of leading zero bits in the 32-bit binary representation.
§type

cos

(Safe copy) Returns the cosine of a number.
§type

cosh

(Safe copy) Returns the hyperbolic cosine of a number.
§type

E

(Safe copy) The mathematical constant e, approximately 2.718.
§type

exp

(Safe copy) Returns e raised to the power of a number.
§type

expm1

(Safe copy) Returns e raised to the power of a number minus 1.
§type

floor

(Safe copy) Returns the largest integer less than or equal to a number.
§type

fround

(Safe copy) Returns the nearest 32-bit single precision float representation.
§type

hypot

(Safe copy) Returns the square root of the sum of squares of its arguments.
§type

imul

(Safe copy) Returns the result of the C-like 32-bit multiplication.
§type

LN10

(Safe copy) The natural logarithm of 10, approximately 2.303.
§type

LN2

(Safe copy) The natural logarithm of 2, approximately 0.693.
§type

log

(Safe copy) Returns the natural logarithm of a number.
§type

log10

(Safe copy) Returns the base-10 logarithm of a number.
§type

LOG10E

(Safe copy) The base-10 logarithm of e, approximately 0.434.
§type

log1p

(Safe copy) Returns the natural logarithm of 1 + a number.
§type

log2

(Safe copy) Returns the base-2 logarithm of a number.
§type

LOG2E

(Safe copy) The base-2 logarithm of e, approximately 1.443.
§type

Math

(Safe copy) Namespace object containing all Math utilities. Note: Importing this imports all methods in this namespace (no tree-shaking).
§type

max

(Safe copy) Returns the larger of zero or more numbers.
§type

min

(Safe copy) Returns the smaller of zero or more numbers.
§type

PI

(Safe copy) The mathematical constant π, approximately 3.14159.
§type

pow

(Safe copy) Returns the base to the exponent power.
§type

random

(Safe copy) Returns a pseudo-random number between 0 and 1. Note: This is NOT cryptographically secure. For secure random values, use crypto.getRandomValues().
§type

round

(Safe copy) Returns the value of a number rounded to the nearest integer.
§type

sign

(Safe copy) Returns the sign of a number (-1, 0, or 1).
§type

sin

(Safe copy) Returns the sine of a number.
§type

sinh

(Safe copy) Returns the hyperbolic sine of a number.
§type

sqrt

(Safe copy) Returns the square root of a number.
§type

SQRT1_2

(Safe copy) The square root of 1/2, approximately 0.707.
§type

SQRT2

(Safe copy) The square root of 2, approximately 1.414.
§type

tan

(Safe copy) Returns the tangent of a number.
§type

tanh

(Safe copy) Returns the hyperbolic tangent of a number.
§type

trunc

(Safe copy) Returns the integer part of a number by removing fractional digits.