Re:Diagnosing a Linux-only unit test failure
by xioxox on Monday October 09, 2017 @11:37AM
(#15434745)
That's absolutely fine if they are set with explicit values or were assigned with the same double. The main issues used to be with the old x86 80 bit wide floating point registers which meant you could sometimes find x != x depending on whether the number went to memory and back.
[ Parent
| on HN ]
Re:Diagnosing a Linux-only unit test failure
by twic on Monday October 09, 2017 @01:34PM
(#15435786)
There's also oddity around NaN - if x is NaN, then, on a compliant chip, x != x regardless of whether it's ever visited main memory.
If you find some reason to use a NaN inside one of these GeoPoints (at one of the poles, perhaps), and the equality of them depends on the equality of doubles, then you may give your users a bit of a surprise.