feat: implement function unequal

This commit is contained in:
Jos de Jong 2022-12-22 14:59:48 +01:00
parent fbec410c42
commit 9aec1bca17
1 changed files with 19 additions and 12 deletions

View File

@ -1,11 +1,12 @@
import { configDependency } from '../core/Config.js'
import {Signature, ImpType} from '../core/Dispatcher.js'
import { Signature, ImpType, Dependency } from '../core/Dispatcher.js'
const DBL_EPSILON = Number.EPSILON || 2.2204460492503130808472633361816E-16
declare module "./type" {
interface NumbersReturn<Params> {
equal: Signature<Params, [number, number], boolean>
unequal: Signature<Params, [number, number], boolean>
}
}
@ -25,3 +26,9 @@ export const equal =
return false
}
export const unequal = (dep: Dependency<'equal', [number, number]>):
ImpType<'unequal', [number, number]> =>
(x, y) => {
return !dep.equal(x, y)
}