diff --git a/src/core/stuff.c b/src/core/stuff.c index bcdf3d1f..b51687b6 100644 --- a/src/core/stuff.c +++ b/src/core/stuff.c @@ -196,9 +196,7 @@ NOINLINE B append_fmt(B s, char* p, ...) { } #define CMP(W,X) ({ AUTO wt = (W); AUTO xt = (X); (wt>xt?1:0)-(wtxt?1:0)-(wtx, 0 if w≡x; 0==compare(NaN,NaN) + if (isNum(w) & isNum(x)) return CMP(o2fu(w), o2fu(x)); + if (isC32(w) & isC32(x)) return CMP(o2cu(w), o2cu(x)); + return compareR(w, x); +} +#undef CMP diff --git a/src/h.h b/src/h.h index 73fec9de..ddf3dbac 100644 --- a/src/h.h +++ b/src/h.h @@ -265,7 +265,6 @@ void print(B x); // doesn't consume void arr_print(B x); // doesn't consume bool equal(B w, B x); // doesn't consume bool eequal(B w, B x); // doesn't consume -i32 compare(B w, B x); // doesn't consume; -1 if wx, 0 if w≡x; 0==compare(NaN,NaN) bool atomEqual(B w, B x); // doesn't consume u64 depth(B x); // doesn't consume B toCells(B x); // consumes