aboutsummaryrefslogtreecommitdiff
path: root/lib/std/math/float.zig
AgeCommit message (Collapse)Author
2025-07-22aarch64: add new from scratch self-hosted backendJacob Young
2025-06-19x86_64: increase passing test coverage on windowsJacob Young
Now that codegen has no references to linker state this is much easier. Closes #24153
2025-06-15big.int: implement float conversionsJacob Young
These conversion routines accept a `round` argument to control how the result is rounded and return whether the result is exact. Most callers wanted this functionality and had hacks around it being missing. Also delete `std.math.big.rational` because it was only being used for float conversion, and using rationals for that is a lot more complex than necessary. It also required an allocator, whereas the new integer routines only need to be passed enough memory to store the result.
2024-10-02std.math: Re-enable snan() test.Alex Rønne Petersen
This now passes on all targets that we test in CI. See: https://github.com/ziglang/zig/issues/14366
2024-08-28std: update `std.builtin.Type` fields to follow naming conventionsmlugg
The compiler actually doesn't need any functional changes for this: Sema does reification based on the tag indices of `std.builtin.Type` already! So, no zig1.wasm update is necessary. This change is necessary to disallow name clashes between fields and decls on a type, which is a prerequisite of #9938.
2024-05-30math.hypot: fix incorrect over/underflow behavior (#19472)expikr
2024-02-26Change many test blocks to doctests/decltestsRyan Liptak
2024-02-26Remove redundant test name prefixes now that test names are fully qualifiedRyan Liptak
Follow up to #19079, which made test names fully qualified. This fixes tests that now-redundant information in their test names. For example here's a fully qualified test name before the changes in this commit: "priority_queue.test.std.PriorityQueue: shrinkAndFree" and the same test's name after the changes in this commit: "priority_queue.test.shrinkAndFree"
2024-01-03Fix compile errors from the `expectEqual` changeCarl Åstholm
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