1 # tests that NaN is handled properly by
2 # floating point comparisons
4 export function w $lt(d %x, d %y) {
10 export function w $le(d %x, d %y) {
16 export function w $gt(d %x, d %y) {
22 export function w $ge(d %x, d %y) {
28 export function w $eq1(d %x, d %y) {
34 export function w $eq2(d %x, d %y) {
44 export function w $eq3(d %x, d %y) {
54 export function w $ne1(d %x, d %y) {
60 export function w $ne2(d %x, d %y) {
70 export function w $ne3(d %x, d %y) {
80 export function w $o(d %x, d %y) {
86 export function w $uo(d %x, d %y) {
94 # extern int lt(double, double);
95 # extern int le(double, double);
96 # extern int gt(double, double);
97 # extern int ge(double, double);
98 # extern int eq1(double, double);
99 # extern int eq2(double, double);
100 # extern int eq3(double, double);
101 # extern int ne1(double, double);
102 # extern int ne2(double, double);
103 # extern int ne3(double, double);
104 # extern int o(double, double);
105 # extern int uo(double, double);
107 # /* LessThan Equal GreaterThan Unordered */
108 # return !lt(0, 1) + lt(0, 0) + lt(1, 0) + lt(NAN, NAN)
109 # + !le(0, 1) + !le(0, 0) + le(1, 0) + le(NAN, NAN)
110 # + gt(0, 1) + gt(0, 0) + !gt(1, 0) + gt(NAN, NAN)
111 # + ge(0, 1) + !ge(0, 0) + !ge(1, 0) + ge(NAN, NAN)
112 # + eq1(0, 1) + !eq1(0, 0) + eq1(1, 0) + eq1(NAN, NAN)
113 # + eq2(0, 1) + !eq2(0, 0) + eq2(1, 0) + eq2(NAN, NAN)
114 # + eq3(0, 1) + !eq3(0, 0) + eq3(1, 0) + eq3(NAN, NAN)
115 # + !ne1(0, 1) + ne1(0, 0) + !ne1(1, 0) + !ne1(NAN, NAN)
116 # + !ne2(0, 1) + ne2(0, 0) + !ne2(1, 0) + !ne2(NAN, NAN)
117 # + !ne3(0, 1) + ne3(0, 0) + !ne3(1, 0) + !ne3(NAN, NAN)
118 # + !o(0, 1) + !o(0, 0) + !o(1, 0) + o(NAN, NAN)
119 # + uo(0, 1) + uo(0, 0) + uo(1, 0) + !uo(NAN, NAN)