Once again, I got surprised by the 80 bit x87 FPU stuff.
First time was around a decade ago. Back then, it was something along the lines of a sort function like:
1 2 3 4 5 6 7 8 9 |
struct ValueSorter() { bool operator (const Value& first, const Value& second) const { double valueFirst = first.amount() * first.value(); double valueSecond = second.amount() * second.value(); return valueFirst < valueSecond; } } |
With some values, first and would be smaller than second, and second smaller than first. All depending on which one got truncated to 64 bit, and which one came directly from the 80bit fpu.
This time, the 80 bit version when cast to integers was 1 smaller than the 64 bit version.
Oh. The joys of x86 CPU’s.
m68k also has an 80 bit modeā¦