PIXI.floatEqual

floatEqual(a: number, b: number, epsilon: number) → {boolean}

The idea of a relative epsilon comparison is to find the difference between the two numbers, and see if it is less than a given epsilon. A good epsilon would be the N% of the largest of the two values or Math.EPSILON.

Note: Only available with @pixi/math-extras.

Parameters:
Name Type Description
a number

First floating number to compare.

b number

Second floating number to compare.

epsilon number

The epsilon to compare to. The larger the epsilon, the easier for the numbers to be considered equals.

Returns:
Type Description
boolean

Returns true if the difference between the values is less than the given epsilon; otherwise false.

Powered by webdoc!