Skip to content

Commit 4d019fb

Browse files
committed
'Fix' WASM error in intforD
1 parent c1218e1 commit 4d019fb

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

jsrc/j.h

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,12 +1190,15 @@ struct jtimespec jmtfclk(void); //'fast clock'; maybe less inaccurate; intended
11901190
#define FFEQ(u,v) (ABS((u)-(v))<=FUZZ*MAX(ABS(u),ABS(v)))
11911191
#define FFIEQ(u,v) (ABS((u)-(v))<=FUZZ*ABS(v)) // used when v is known to be exact integer. It's close enough, maybe ULP too small on the high end
11921192
// see if i is close enough to f that it can be used in place of f without loss of significance. i is round(f).
1193-
#if SY_64
1194-
#define ISFTOIOK(f,i) (ABS(f)<-(D)IMIN && ((f)==(i) || FFIEQ(f,i))) // 64 bit: a float of IMIN does not equal integer IMIN
1195-
#else
1196-
#define ISFTOIOK(f,i) ((f)==(I)(i) || (ABS(f)<-(D)IMIN && FFIEQ(f,i))) // 32 bit: float IMIN is exactly integer IMIN
1197-
#endif
1198-
#define ISFTOIOKFZ(f,i,fuzz) (ABS(f)<-(D)IMIN && ((f)==(i) || FIEQ(f,i,fuzz))) // same, but variable fuzz
1193+
// obsolete #if SY_64
1194+
// obsolete #define ISFTOIOK(f,i) (ABS(f)<-(D)IMIN && ((f)==(i) || FFIEQ(f,i))) // 64 bit: a float of IMIN does not equal integer IMIN
1195+
#define ISFTOIOK(f,i) (likely((f)<FLIMAX) && likely((f)>=FLIMIN) && (likely((f)==(i)) || FFIEQ(f,i))) // a float of IMAX does not equal integer IMAX in 64-bit
1196+
// obsolete #else
1197+
// obsolete #define ISFTOIOK(f,i) ((f)==(I)(i) || (ABS(f)<-(D)IMIN && FFIEQ(f,i))) // 32 bit: float IMIN is exactly integer IMIN
1198+
// obsolete #define ISFTOIOK(f,i) ((f)==(I)(i) || (ABS(f)<-(D)IMIN && FFIEQ(f,i))) // 32 bit: float IMIN is exactly integer IMIN
1199+
// obsolete #endif
1200+
// obsolete #define ISFTOIOKFZ(f,i,fuzz) (ABS(f)<-(D)IMIN && ((f)==(i) || FIEQ(f,i,fuzz))) // same, but variable fuzz
1201+
#define ISFTOIOKFZ(f,i,fuzz) (likely((f)<FLIMAX) && likely((f)>=FLIMIN) && (likely((f)==(i)) || FIEQ(f,i,fuzz))) // same, but variable fuzz
11991202
#define F1(f) A f(JJ jtfg, A w) // whether in an interface routine or not, these must use the internal parameter type
12001203
#define F2(f) A f(JJ jtfg,A a,A w)
12011204
#define F12IP JJ jt=(JJ)(intptr_t)((I)jtfg&~JTFLAGMSK)

0 commit comments

Comments
 (0)