Keep the operator of a negated float comparison
Js_exp_make.not negated a comparison by swapping its operator, turning !(x < 0.0) into x >= 0.0, which is false for NaN. Float comparisons, and comparisons of operands of unknown type, now use their own operators, printed as <, <=, >, >=, which not leaves as !(…). Fixes #9026.
modifiedJS negated float comparison
let k = (x: float) => !(x < 0.0)js
Before
After
function k(x) {function k(x) { return x >= 0.0; return !(x < 0.0);}}
Review
- Do int, bigint and string comparisons change? No, they keep the old operators, so negating them still swaps the operator. The only changed output is in caml_compare_bigint_test, whose bigint values are typed as float.