mirror of
https://codeberg.org/ziglang/zig
synced 2026-11-18 07:05:05 +00:00
stage2: hash/eql of fixed-size floats use bit pattern
Zig guarantees the memory layout of f16, f32, f64, f80, and f128 which means for generic function purposes, values of these types need to be compared on the basis of their bits in memory. This means nan-packing can be used with generic functions, for example. For comptime_float, the sign is observable, whether it is nan is observable, but not any more kinds of bit patterns are observable. This fixes the std.fmt tests that check printing "-nan".
This commit is contained in:
parent
6bc6e47b15
commit
c8531faaf5
1 changed files with 35 additions and 15 deletions
Loading…
Add table
Add a link
Reference in a new issue