aboutsummaryrefslogtreecommitdiff
path: root/lib/std/math/float.zig
AgeCommit message (Collapse)Author
2023-08-18Make NaNs quiet by default and other NaN tidy-up (#16826)Lewis Gaul
* Generalise NaN handling and make std.math.nan() give quiet NaNs * Address uses of std.math.qnan_* and std.math.nan_* consts * Comment out failing test due to issues with signalling NaN * Fix issue in c_builtins.zig where we need qnan_u32
2023-06-24all: migrate code to new cast builtin syntaxmlugg
Most of this migration was performed automatically with `zig fmt`. There were a few exceptions which I had to manually fix: * `@alignCast` and `@addrSpaceCast` cannot be automatically rewritten * `@truncate`'s fixup is incorrect for vectors * Test cases are not formatted, and their error locations change
2022-08-22Sema: fix parameter of type 'T' must be comptime errorVeikka Tuominen
Closes #12519 Closes #12505
2022-07-13stage2: fix comptime bitcast involving f80Andrew Kelley
* Sema: implement comptime bitcast of f80 with integer-like types bitwise rather than taking a round trip through memory layout. * Type: introduce `isAbiInt`. * Value: comptime memory write of f80 writes 0 bytes for padding instead of leaving the memory uninitialized. * Value: floatReadFromMemory has a more general implementation, checking the endianness rather than checking for specific architectures. This fixes behavior test failures occurring on MIPS.
2022-07-13std.math: add `inline` to some functionsAndrew Kelley
These functions semantically benefit from being inline; it makes sense that `isInf(x)` where `x` is comptime-known should have a comptime-known result.
2022-04-14std.math.float: fix f80-backed c_longdouble constsvi
2022-04-12Add `floatFractionalBits` to replace `floatMantissaDigits`Cody Tapscott
2022-04-07std.math: generalise `inf`, even simpler `isFinite`viri
2022-04-06derive float constants in a generic way (#10133)viri