Skip to content

Commit 703ff68

Browse files
ahrzbclaude
andcommitted
docs(interp): fcmp header bullet describes duck_fcmp order, not stale IEEE claim
The Inst::Cmp F64 arm has used exec::duck_fcmp (NaN = NaN, NaN above everything, -0.0 = 0.0) since the DuckDB pin; the module header still claimed IEEE-ordered NaN-is-false semantics. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 0237567 commit 703ff68

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/specializer/exec/interp.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88
//! * `iadd`/`isub`/`imul` trap on i64 overflow (SQL overflow is an error,
99
//! not a wrap); `idiv`/`irem` trap on zero and on `i64::MIN / -1`.
1010
//! * `f*` arithmetic is raw IEEE — inf/nan flow through, no traps.
11-
//! * `fcmp` is IEEE-ordered: every predicate involving NaN is false, except
12-
//! `ne`, which is `!(a == b)` and therefore true. SQL NULL/NaN policy is
13-
//! the lowering's job, expressed with flags around these primitives.
11+
//! * `fcmp` uses DuckDB's DOUBLE order (`exec::duck_fcmp`): IEEE except that
12+
//! NaN equals NaN and sorts above everything, and `-0.0 = 0.0`. SQL
13+
//! NULL/NaN policy is the lowering's job, expressed with flags around
14+
//! these primitives.
1415
//! * `icmp` is i64 order; `scmp` is byte order (Rust `str` cmp).
1516
//! * `itof` is `as f64` (may round — same as DuckDB's BIGINT->DOUBLE).
1617
//! * `ftoi.trunc` rounds toward zero; `ftoi.round` half-away-from-zero

0 commit comments

Comments
 (0)