amd64 does yet something else. amd64 (a == b) (a >= b) (a > b) (b == a) (b >= a) (b > a) 386 (a < b) (a <= b) (a == b) (b < a) (b <= a) (b == a) arm (a < b) (a <= b) (a != b) (b < a) (b <= a) (b != a) mips (a < b) (a <= b) (a != b) (b < a) (b <= a) (b != a)
> mainly the assumption, in the compiler and linker, that something like this: > if (a < b) f(); > can safely be transformed to this: > if (a >= b) goto skip; > f(); > skip: > Unfortunately if a or b is NaN, the conditional will be false in both cases. > > So is this a feature, or a bug that needs fixing? how about another option, just a bug. there are other issues with the floating point, including the fact that -0.0 is transformed both by the compiler, and by print(2) to 0.0. ape's printf prints -0.0 correctly. at least in terms of passing floating point test suites (like python's) the NaN issue doesn't come up, but the -0 issue breaks a number of tests. - erik