File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -37,21 +37,21 @@ I FC(F a, F b)//Floating-Point Compare
37
37
#else
38
38
{
39
39
// adaptive ULP
40
- union {I i ;F f ;} x ,y ;I xu ,d , ad ;
40
+ union {I i ;F f ;} x ,y ;I xu ,ad ;
41
41
x .f = a ;y .f = b ;xu = x .i |y .i ;
42
42
if (Inan (x .i ))R Inan (y .i )?0 :-1 ;
43
43
else if (x .i < 0 )x .i = LLONG_MIN - x .i ;
44
44
if (Inan (y .i ))R 1 ;
45
45
else if (y .i < 0 )y .i = LLONG_MIN - y .i ;
46
- ad = llabs (d = x .i - y .i );
46
+ ad = llabs (x .i - y .i );
47
47
if (ad < 1023 ){
48
- if (Isubn (xu ))R d < 0 ?-1 :d ?1 :0 ;
48
+ if (Isubn (xu ))R x . i < y . i ?-1 :x . i != y . i ?1 :0 ;
49
49
if (ad < 513 )R 0 ;
50
50
// sxxx xxxx xxxx uuuu uuuu ....
51
51
xu = 513 + ((255 & (xu >>44 ))<<1 );
52
52
if (ad < xu )R 0 ;
53
53
}
54
- R d < 0 ?-1 :1 ;
54
+ R x . i < y . i ?-1 :1 ;
55
55
}
56
56
#endif
57
57
}
Original file line number Diff line number Diff line change @@ -747,6 +747,9 @@ Z I tests02()
747
747
TC (("" ;"";" ";" "), " a "\"aaa" )
748
748
TC_ ("x:.+(`a`b;1 2); y:x; f:{.[x;,`a;:;11]}; f`y; x" ,".+(`a`b;1 2)" )
749
749
TC_ ("x:.+(`a`b;1 2); y:x; f:{.[x;,`a;:;11]}; f`y; y" ,".+(`a`b;11 2)" )
750
+ TC (1 , -20 < 10 )
751
+ TC (1 , -20.0 < 10.0 )
752
+ TC (1 , -10.0 < 20 )
750
753
#ifdef K3_ARITH
751
754
TC (0 i , 0 i + 0 i ) // plus
752
755
TC (0 i , 0 i + 0 I )
You can’t perform that action at this time.
0 commit comments