Skip to content

Math.isEpsilon()

Description

Returns true, if the absolute value of arg is less than or equal to eps.

Syntax

JS
Math.isEpsilon(arg: Number, eps: Number = Math.EPSILON) -> Boolean

Parameters

Parameter Type Default Value Mandatory Description
arg Number ✅ Numerical value being processed.
eps Number Math.EPSILON Comparison precision for floating-point numbers.

Return value

Type Description
Boolean Result of the operation.

Example

JS
1
2
3
4
let b1 = Math.isEpsilon(0.0001);
console.info(b1); // output: false
let b2 = Math.isEpsilon(1e-8, Math.EPSILON);
console.info(b2); // output: true
Last update: 14 August 2025, 18:47