Open ozum opened 11 months ago
To-date, numbers have been treated as true primitives, and explicitly used SameValueZero
comparison for equality checks without an override. However, I can see the use-case for having custom comparators for primitives, such as the numeric float example you provide. I can add arePrimitivesEqual
support.
Hi,
I need to use a custom comparison function for numbers for my use case. This function returns
true
for equality check when two floating point numbers are very close, even if they are not equal. Below is a simple implementation:How can I use this function in numeric comparisons in
fast-equals
?Many thanks,