re: How to correctly compare floating point numbers for equality VIEW POST


The "correct" way would be for ECMA group to abstract this gotcha into an override of the == and/or === operators for floats in an upcoming version of ES :D... but good tip!


That would certainly be breaking.
I feel like I wouldn't mind them doing that to ==, which means "approximately equal" in my head, but in reality that would become a reason to use == with all its coercions and we definitely don't need that.

code of conduct - report abuse