Create New Item
×
Item Type
File
Folder
Item Name
×
Search file in folder and subfolders...
File Manager
/
sommilito-bank2
/
splide-4.1.3
/
src
/
js
/
utils
/
math
/
approximatelyEqual
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
import { abs } from '../math/math'; /** * Checks if the provided 2 numbers are approximately equal or not. * * @param x - A number. * @param y - Another number to compare. * @param epsilon - An accuracy that defines the approximation. * * @return `true` if 2 numbers are considered to be equal, or otherwise `false`. */ export function approximatelyEqual( x: number, y: number, epsilon: number ): boolean { return abs( x - y ) < epsilon; }