ziglang/zig
261
6.0k
Fork
You've already forked zig
772

libzigc/math: Implement rintl, lrintl #31791

Merged
andrewrk merged 7 commits from mihael/zig:libzigc/math-functions into master 2026年04月27日 16:49:14 +02:00
Contributor
Copy link

It's a fairly straightforward port of musl's rintl, like rint and rintf were. libc-test tests for rintl are uncommented since they're now passing, and, as always, the results are attached to the relevant implementation commits.

I've also covered special cases for rint with tests, and broke down the current rint and modf test declarations into multiple -- so each libc function get its own test declaration at the very least.

Contributes to #30978

It's a fairly straightforward port of `musl`'s `rintl`, like `rint` and `rintf` were. `libc-test` tests for `rintl` are uncommented since they're now passing, and, as always, the results are attached to the relevant implementation commits. I've also covered special cases for `rint` with tests, and broke down the current `rint` and `modf` test declarations into multiple -- so each libc function get its own test declaration at the very least. Contributes to #30978
mihael changed title from (削除) libzigc/math-functions (削除ここまで) to libzigc/math: Implement rintl, lrintl 2026年04月09日 00:04:12 +02:00
andrewrk requested changes 2026年04月09日 21:04:50 +02:00
Dismissed
andrewrk left a comment
Copy link

Thanks for the patch.

Hmmm I think this long_double.zig file should not exist because the logic belongs in std.math.float.

Generally, nothing should directly import anything from compiler_rt (I'm looking at @import("../compiler_rt/long_double.zig");). Instead, zig libc should import std and compiler_rt should import std.

Thanks for the patch. Hmmm I think this long_double.zig file should not exist because the logic belongs in std.math.float. Generally, nothing should directly import anything from compiler_rt (I'm looking at `@import("../compiler_rt/long_double.zig");`). Instead, zig libc should import std and compiler_rt should import std.
mihael force-pushed libzigc/math-functions from fa7d542215
All checks were successful
ci / x86_64-freebsd-release (pull_request) Successful in 37m20s
ci / x86_64-netbsd-release (pull_request) Successful in 37m38s
ci / aarch64-macos-release (pull_request) Successful in 49m9s
ci / x86_64-netbsd-debug (pull_request) Successful in 54m3s
ci / x86_64-freebsd-debug (pull_request) Successful in 55m3s
ci / x86_64-linux-debug (pull_request) Successful in 55m35s
ci / x86_64-openbsd-release (pull_request) Successful in 1h3m43s
ci / aarch64-macos-debug (pull_request) Successful in 1h10m3s
ci / x86_64-windows-release (pull_request) Successful in 1h16m23s
ci / x86_64-windows-debug (pull_request) Successful in 1h18m12s
ci / x86_64-openbsd-debug (pull_request) Successful in 1h21m24s
ci / aarch64-linux-release (pull_request) Successful in 1h26m27s
ci / s390x-linux-release (pull_request) Successful in 1h38m7s
ci / x86_64-linux-debug-llvm (pull_request) Successful in 1h56m21s
ci / x86_64-linux-release (pull_request) Successful in 2h5m44s
ci / aarch64-linux-debug (pull_request) Successful in 2h33m44s
ci / s390x-linux-debug (pull_request) Successful in 3h0m9s
ci / powerpc64le-linux-release (pull_request) Successful in 1h31m16s
ci / powerpc64le-linux-debug (pull_request) Successful in 4h44m2s
ci / loongarch64-linux-release (pull_request) Successful in 2h9m30s
ci / loongarch64-linux-debug (pull_request) Successful in 3h23m27s
ci / riscv64-linux-debug (pull_request) Has been skipped
ci / riscv64-linux-release (pull_request) Has been skipped
ci / aarch64-freebsd-debug (pull_request) Successful in 3h44m33s
ci / aarch64-freebsd-release (pull_request) Successful in 2h31m35s
ci / aarch64-netbsd-debug (pull_request) Successful in 3h56m9s
ci / aarch64-netbsd-release (pull_request) Successful in 2h59m36s
to 15d3884cc2
All checks were successful
ci / aarch64-macos-release (pull_request) Successful in 52m45s
ci / aarch64-macos-debug (pull_request) Successful in 1h9m30s
ci / x86_64-linux-debug (pull_request) Successful in 1h9m46s
ci / x86_64-netbsd-release (pull_request) Successful in 41m0s
ci / x86_64-freebsd-release (pull_request) Successful in 39m32s
ci / x86_64-netbsd-debug (pull_request) Successful in 1h3m11s
ci / x86_64-freebsd-debug (pull_request) Successful in 1h2m53s
ci / aarch64-linux-release (pull_request) Successful in 1h38m13s
ci / x86_64-openbsd-release (pull_request) Successful in 1h2m36s
ci / s390x-linux-release (pull_request) Successful in 1h43m24s
ci / x86_64-openbsd-debug (pull_request) Successful in 1h30m19s
ci / x86_64-windows-release (pull_request) Successful in 1h7m5s
ci / x86_64-windows-debug (pull_request) Successful in 1h45m49s
ci / aarch64-linux-debug (pull_request) Successful in 2h35m44s
ci / x86_64-linux-release (pull_request) Successful in 2h51m57s
ci / s390x-linux-debug (pull_request) Successful in 2h46m8s
ci / x86_64-linux-debug-llvm (pull_request) Successful in 3h0m38s
ci / powerpc64le-linux-release (pull_request) Successful in 1h36m55s
ci / loongarch64-linux-debug (pull_request) Successful in 3h11m18s
ci / loongarch64-linux-release (pull_request) Successful in 2h2m53s
ci / powerpc64le-linux-debug (pull_request) Successful in 4h40m23s
ci / riscv64-linux-debug (pull_request) Has been skipped
ci / riscv64-linux-release (pull_request) Has been skipped
ci / aarch64-freebsd-debug (pull_request) Successful in 3h43m6s
ci / aarch64-freebsd-release (pull_request) Successful in 3h0m58s
ci / aarch64-netbsd-debug (pull_request) Successful in 4h7m22s
ci / aarch64-netbsd-release (pull_request) Successful in 2h46m20s
2026年04月13日 13:21:53 +02:00
Compare
mihael left a comment
Copy link

Thought that import might be a bit iffy. I moved the long_double.zig logic into math.std.float, touched it up a bit, and added a couple of tests in a follow-up commit. Ran the full libc test suite too.

But this is something I'd like to get back to. I'm playing around with an idea of a packed struct that holds a bit representation of a float and offers a nice API for these bit manipulation/checking operations. Ideally, it would also support all the float types, not just the long double ones. That would come in handy when dealing with musl ports and making them a little easier to read and work with. Should it work, it would supersede the long double namespace.

Thought that import might be a bit iffy. I moved the `long_double.zig` logic into `math.std.float`, touched it up a bit, and added a couple of tests in a follow-up commit. Ran the full `libc` test suite too. But this is something I'd like to get back to. I'm playing around with an idea of a packed struct that holds a bit representation of a float and offers a nice API for these bit manipulation/checking operations. Ideally, it would also support all the float types, not just the `long double` ones. That would come in handy when dealing with `musl` ports and making them a little easier to read and work with. Should it work, it would supersede the `long double` namespace.
@ -7,0 +14,4 @@
constT=@TypeOf(x);
returnswitch(T){
f80,f128,c_longdouble=>@typeInfo(T).float.bits,
else=>@compileError("Unsupported type: "++@typeName(T)++"\nPass a `f80`, `f128`, or `c_longdouble`."),
Author
Contributor
Copy link

I'm not aware of any guidelines for user-facing compilation errors.
I could've done an assert like it's done in a couple of places in float.zig:

comptimeassert(@TypeOf(x)==f80or@TypeOf(x)==f128or@TypeOf(x)==c_longdouble);

but I thought this way provided a more helpful error message. I find this a little more user-friendly:

lib/std/math/float.zig:17:21: error: Unsupported type: f64
 Pass a `f80`, `f128`, or `c_longdouble`.
 else => @compileError("Unsupported type: " ++ @typeName(T) ++ "\nPass a `f80`, `f128`, or `c_longdouble`."),
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/std/math/float.zig:47:35: note: called inline here
 const bit_width = bitWidth(x);

than this:

lib/std/debug.zig:421:14: error: reached unreachable code
 if (!ok) unreachable; // assertion failure
 ^~~~~~~~~~~
lib/std/math/float.zig:14:24: note: called at comptime here
 comptime assert(@TypeOf(x) == f80 or @TypeOf(x) == f128 or @TypeOf(x) == c_longdouble);
 ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/std/math/float.zig:50:35: note: called inline here
 const bit_width = bitWidth(x);

It doesn't seem consistent within std.math.float.zig either. There are examples of those asserts I mentioned, but then there's also another example of using switch & @compilerError:

pubinlinefnfloatEpsAt(comptimeT:type,x:T)T{switch(@typeInfo(T)){.float=>|F|{constU:type=@Int(.unsigned,F.bits);constu:U=@bitCast(x);consty:T=@bitCast(u^1);return@abs(x-y);},else=>@compileError("floatEpsAt only supports floats"),}}

Not sure if there are any guidelines on what's the best approach to handling user-facing compilation errors in the codebase.

I'm not aware of any guidelines for user-facing compilation errors. I could've done an `assert` like it's done in a couple of places in `float.zig`: ```zig comptime assert(@TypeOf(x) == f80 or @TypeOf(x) == f128 or @TypeOf(x) == c_longdouble); ``` but I thought this way provided a more helpful error message. I find this a little more user-friendly: ``` lib/std/math/float.zig:17:21: error: Unsupported type: f64 Pass a `f80`, `f128`, or `c_longdouble`. else => @compileError("Unsupported type: " ++ @typeName(T) ++ "\nPass a `f80`, `f128`, or `c_longdouble`."), ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ lib/std/math/float.zig:47:35: note: called inline here const bit_width = bitWidth(x); ``` than this: ``` lib/std/debug.zig:421:14: error: reached unreachable code if (!ok) unreachable; // assertion failure ^~~~~~~~~~~ lib/std/math/float.zig:14:24: note: called at comptime here comptime assert(@TypeOf(x) == f80 or @TypeOf(x) == f128 or @TypeOf(x) == c_longdouble); ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ lib/std/math/float.zig:50:35: note: called inline here const bit_width = bitWidth(x); ``` It doesn't seem consistent within `std.math.float.zig` either. There are examples of those asserts I mentioned, but then there's also another example of using `switch` & `@compilerError`: ```zig pub inline fn floatEpsAt(comptime T: type, x: T) T { switch (@typeInfo(T)) { .float => |F| { const U: type = @Int(.unsigned, F.bits); const u: U = @bitCast(x); const y: T = @bitCast(u ^ 1); return @abs(x - y); }, else => @compileError("floatEpsAt only supports floats"), } } ``` Not sure if there are any guidelines on what's the best approach to handling user-facing compilation errors in the codebase.
Author
Contributor
Copy link

@mihael wrote in #31791 (comment):

But this is something I'd like to get back to. I'm playing around with an idea of a packed struct that holds a bit representation of a float and offers a nice API for these bit manipulation/checking operations. Ideally, it would also support all the float types, not just the long double ones. That would come in handy when dealing with musl ports and making them a little easier to read and work with. Should it work, it would supersede the long double namespace.

Though the FloatRepr is on track of what I was thinking of, just with more abstraction than I was envisioning, but that shouldn't be a detractor if there's no performance penalty. We could lean on using FloatRepr in more places and a couple of useful helper methods.

@mihael wrote in https://codeberg.org/ziglang/zig/pulls/31791#issuecomment-13066878: > But this is something I'd like to get back to. I'm playing around with an idea of a packed struct that holds a bit representation of a float and offers a nice API for these bit manipulation/checking operations. Ideally, it would also support all the float types, not just the `long double` ones. That would come in handy when dealing with `musl` ports and making them a little easier to read and work with. Should it work, it would supersede the `long double` namespace. Though the `FloatRepr` is on track of what I was thinking of, just with more abstraction than I was envisioning, but that shouldn't be a detractor if there's no performance penalty. We could lean on using `FloatRepr` in more places and a couple of useful helper methods.
andrewrk requested changes 2026年04月17日 22:33:42 +02:00
Dismissed
andrewrk left a comment
Copy link

I believe this is now unblocked since #31923 landed.

I believe this is now unblocked since #31923 landed.
mihael force-pushed libzigc/math-functions from 15d3884cc2
All checks were successful
ci / aarch64-macos-release (pull_request) Successful in 52m45s
ci / aarch64-macos-debug (pull_request) Successful in 1h9m30s
ci / x86_64-linux-debug (pull_request) Successful in 1h9m46s
ci / x86_64-netbsd-release (pull_request) Successful in 41m0s
ci / x86_64-freebsd-release (pull_request) Successful in 39m32s
ci / x86_64-netbsd-debug (pull_request) Successful in 1h3m11s
ci / x86_64-freebsd-debug (pull_request) Successful in 1h2m53s
ci / aarch64-linux-release (pull_request) Successful in 1h38m13s
ci / x86_64-openbsd-release (pull_request) Successful in 1h2m36s
ci / s390x-linux-release (pull_request) Successful in 1h43m24s
ci / x86_64-openbsd-debug (pull_request) Successful in 1h30m19s
ci / x86_64-windows-release (pull_request) Successful in 1h7m5s
ci / x86_64-windows-debug (pull_request) Successful in 1h45m49s
ci / aarch64-linux-debug (pull_request) Successful in 2h35m44s
ci / x86_64-linux-release (pull_request) Successful in 2h51m57s
ci / s390x-linux-debug (pull_request) Successful in 2h46m8s
ci / x86_64-linux-debug-llvm (pull_request) Successful in 3h0m38s
ci / powerpc64le-linux-release (pull_request) Successful in 1h36m55s
ci / loongarch64-linux-debug (pull_request) Successful in 3h11m18s
ci / loongarch64-linux-release (pull_request) Successful in 2h2m53s
ci / powerpc64le-linux-debug (pull_request) Successful in 4h40m23s
ci / riscv64-linux-debug (pull_request) Has been skipped
ci / riscv64-linux-release (pull_request) Has been skipped
ci / aarch64-freebsd-debug (pull_request) Successful in 3h43m6s
ci / aarch64-freebsd-release (pull_request) Successful in 3h0m58s
ci / aarch64-netbsd-debug (pull_request) Successful in 4h7m22s
ci / aarch64-netbsd-release (pull_request) Successful in 2h46m20s
to 2aadb5fed9
Some checks failed
ci / x86_64-netbsd-release (pull_request) Failing after 31m59s
ci / x86_64-netbsd-debug (pull_request) Failing after 50m1s
ci / x86_64-freebsd-release (pull_request) Successful in 51m29s
ci / x86_64-windows-release (pull_request) Failing after 57m38s
ci / x86_64-freebsd-debug (pull_request) Successful in 1h1m14s
ci / x86_64-openbsd-release (pull_request) Successful in 1h14m47s
ci / x86_64-linux-debug (pull_request) Successful in 1h15m42s
ci / x86_64-openbsd-debug (pull_request) Successful in 1h22m58s
ci / s390x-linux-release (pull_request) Successful in 1h23m57s
ci / aarch64-macos-release (pull_request) Successful in 1h25m12s
ci / aarch64-linux-release (pull_request) Successful in 1h29m22s
ci / x86_64-windows-debug (pull_request) Failing after 1h32m14s
ci / aarch64-macos-debug (pull_request) Successful in 1h35m34s
ci / powerpc64le-linux-release (pull_request) Failing after 1h36m27s
ci / aarch64-linux-debug (pull_request) Successful in 2h28m42s
ci / s390x-linux-debug (pull_request) Successful in 2h29m3s
ci / x86_64-linux-debug-llvm (pull_request) Successful in 2h33m24s
ci / x86_64-linux-release (pull_request) Successful in 2h40m25s
ci / powerpc64le-linux-debug (pull_request) Failing after 3h42m41s
ci / loongarch64-linux-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-release (pull_request) Has been cancelled
ci / aarch64-netbsd-debug (pull_request) Has been cancelled
ci / aarch64-netbsd-release (pull_request) Has been cancelled
ci / loongarch64-linux-release (pull_request) Has been cancelled
ci / riscv64-linux-debug (pull_request) Has been cancelled
ci / riscv64-linux-release (pull_request) Has been cancelled
2026年04月19日 02:21:21 +02:00
Compare
Author
Contributor
Copy link

Wasn't aware it was blocked, but I'm running into some problems during the test-modules step in Debug mode after rebasing on master. When I run the libc unit tests:

./build/stage3/bin/zig build test-modules test-c-abi -Dtest-target-filter=musl -Dtest-target-filter=windows-gnu -fqemu -fwasmtime --summary all

it falls apart across all targets in Debug mode, e.g.:

  • Wrong values for actual results
  • Special cases also mangled (0 instead of inf, etc.)
  • s390x crashes
  • Crashes for WASM:
test-modules
└─ test-libc
 └─ run test libc-wasm32-wasi-musl-lime1-Debug-libc 2 pass, 1 crash (3 total)
error: 'c.math.test.rintl.normal' exited with code 134 with stderr:
 Error: failed to run main module `./.zig-cache/o/c8ad29b82a33211ea61b45233946f344/test.wasm`
 
 Caused by:
 0: failed to invoke command default
 1: error while executing at wasm backtrace:
 0: 0x5a91a - test.wasm!.Lc.math.rintl_bitcast_invalid
 1: 0x59a0d - test.wasm!c.math.testRintNormal__anon_25472
 2: 0x5a922 - test.wasm!c.math.test.rintl.normal
 3: 0x5ae5 - test.wasm!test_runner.mainServer
 4: 0x3a31 - test.wasm!test_runner.main
 5: 0x34a9 - test.wasm!start.mainWithoutEnv
 6: 0xca4 - test.wasm!__main_void
 7: 0xc07 - test.wasm!_start
 note: using the `WASMTIME_BACKTRACE_DETAILS=1` environment variable may show more debugging information
 2: wasm trap: wasm `unreachable` instruction executed
failed command: wasmtime --dir=. -Sinherit-env ./.zig-cache/o/c8ad29b82a33211ea61b45233946f344/test.wasm --cache-dir=./.zig-cache --seed=0xac1f0997 --listen=-

etc.

Yet ReleaseFast and ReleaseSafe are fine.

That's why I added the Debug skips for rintl tests:

if(builtin.mode==std.builtin.OptimizeMode.Debug)returnerror.SkipZigTest;// TODO

(On a second thought, it'd be better add a filter for the test-modules step to the skip -- should be possible I believe. But I'd have to additionally test that & I wanted to share this before logging off for the day -- more precisely, night :)).

Commenting them out will result in errors when running the above command.
libc-aarch64-linux-musl-generic-Debug-libc, libc-aarch64_be-linux-musl-generic-Debug-libc, and libc-x86_64-linux-musl-x86_64-Debug-libc-llvm-no-lld seem fine even without the skips.

I had investigated, but I'm none the wiser. At first, I thought maybe it could be an issue that I use const toint = 1.0 / math.floatEps(c_longdouble);, the divisor (LDBL EPSILON) would be 0.00000000000000000000000000000000019259299443872358530559779425849273 for f128, whereas musl uses the 80-bit epsilon (1.0842021724855044340e-19) both for f80 and f128 on most architectures (ex., source_code for LDBL_EPSILON, source code for rintl impl). But the issues still persisted.

All tests pass for libc-test suite:

$ ./build/stage3/bin/zig build test-libc-nsz -Dlibc-test-path=<PATH-TO-LIBC-TEST-SUITE> -fqemu -fwasmtime --summary line
Build Summary: 49121/49121 steps succeeded

Other than resolving the conflicts, I also changed the stuff that is deprecated in 0.16 (@intFromFloat, std.meta.Int).
If anyone has any clue why Debug falls apart like that, I'd appreciate it.

Wasn't aware it was blocked, but I'm running into some problems during the `test-modules` step in Debug mode after rebasing on master. When I run the libc unit tests: ```bash ./build/stage3/bin/zig build test-modules test-c-abi -Dtest-target-filter=musl -Dtest-target-filter=windows-gnu -fqemu -fwasmtime --summary all ``` it falls apart across all targets in `Debug` mode, e.g.: - Wrong values for actual results - Special cases also mangled (`0` instead of `inf`, etc.) - `s390x` crashes - Crashes for WASM: ```bash test-modules └─ test-libc └─ run test libc-wasm32-wasi-musl-lime1-Debug-libc 2 pass, 1 crash (3 total) error: 'c.math.test.rintl.normal' exited with code 134 with stderr: Error: failed to run main module `./.zig-cache/o/c8ad29b82a33211ea61b45233946f344/test.wasm` Caused by: 0: failed to invoke command default 1: error while executing at wasm backtrace: 0: 0x5a91a - test.wasm!.Lc.math.rintl_bitcast_invalid 1: 0x59a0d - test.wasm!c.math.testRintNormal__anon_25472 2: 0x5a922 - test.wasm!c.math.test.rintl.normal 3: 0x5ae5 - test.wasm!test_runner.mainServer 4: 0x3a31 - test.wasm!test_runner.main 5: 0x34a9 - test.wasm!start.mainWithoutEnv 6: 0xca4 - test.wasm!__main_void 7: 0xc07 - test.wasm!_start note: using the `WASMTIME_BACKTRACE_DETAILS=1` environment variable may show more debugging information 2: wasm trap: wasm `unreachable` instruction executed failed command: wasmtime --dir=. -Sinherit-env ./.zig-cache/o/c8ad29b82a33211ea61b45233946f344/test.wasm --cache-dir=./.zig-cache --seed=0xac1f0997 --listen=- ``` etc. Yet `ReleaseFast` and `ReleaseSafe` are fine. That's why I added the Debug skips for `rintl` tests: ```zig if (builtin.mode == std.builtin.OptimizeMode.Debug) return error.SkipZigTest; // TODO ``` (On a second thought, it'd be better add a filter for the `test-modules` step to the skip -- should be possible I believe. But I'd have to additionally test that & I wanted to share this before logging off for the day -- more precisely, night :)). Commenting them out will result in errors when running the above command. `libc-aarch64-linux-musl-generic-Debug-libc`, `libc-aarch64_be-linux-musl-generic-Debug-libc`, and `libc-x86_64-linux-musl-x86_64-Debug-libc-llvm-no-lld` seem fine even without the skips. I had investigated, but I'm none the wiser. At first, I thought maybe it could be an issue that I use `const toint = 1.0 / math.floatEps(c_longdouble);`, the divisor (`LDBL EPSILON`) would be `0.00000000000000000000000000000000019259299443872358530559779425849273` for `f128`, whereas musl uses the 80-bit epsilon (`1.0842021724855044340e-19`) both for `f80` and `f128` on most architectures (ex., [source_code for `LDBL_EPSILON`](https://git.musl-libc.org/cgit/musl/tree/arch/x86_64/bits/float.h?h=v1.2.4&id=ec9f5353b10eb312af391ec799a3eeea5da145a9), [source code for `rintl` impl](https://git.musl-libc.org/cgit/musl/tree/src/math/rintl.c)). But the issues still persisted. All tests pass for `libc-test` suite: ```bash $ ./build/stage3/bin/zig build test-libc-nsz -Dlibc-test-path=<PATH-TO-LIBC-TEST-SUITE> -fqemu -fwasmtime --summary line Build Summary: 49121/49121 steps succeeded ``` Other than resolving the conflicts, I also changed the stuff that is deprecated in `0.16` (`@intFromFloat, std.meta.Int`). If anyone has any clue why Debug falls apart like that, I'd appreciate it.
lib/c/math.zig Outdated
@ -364,6 +371,28 @@ fn rintf(x: f32) callconv(.c) f32 {
returny;
}
fnrintl(x:c_longdouble)c_longdouble{
Contributor
Copy link
@@ -371,7 +371,7 @@ fn rintf(x: f32) callconv(.c) f32 {
 return y;
 }
 
-fn rintl(x: c_longdouble) c_longdouble {
+fn rintl(x: c_longdouble) callconv(.c) c_longdouble {
 if (@typeInfo(c_longdouble).float.bits == 64)
 return rint(x);

I did not run all tests, but this seems to fix your tests on Debug.

```diff @@ -371,7 +371,7 @@ fn rintf(x: f32) callconv(.c) f32 { return y; } -fn rintl(x: c_longdouble) c_longdouble { +fn rintl(x: c_longdouble) callconv(.c) c_longdouble { if (@typeInfo(c_longdouble).float.bits == 64) return rint(x); ``` I did not run all tests, but this seems to fix your tests on `Debug`.
Author
Contributor
Copy link

That was it, what a silly brainfart. Thank you!

Now on to the PowerPC & netbsd CI failures that are popping up...

That was it, what a silly brainfart. Thank you! Now on to the PowerPC & netbsd CI failures that are popping up...
Owner
Copy link

I don't know what's up with the NetBSD failures, but any failures involving c_longdouble on PowerPC can be simply skipped for now. See: #30976

I don't know what's up with the NetBSD failures, but any failures involving `c_longdouble` on PowerPC can be simply skipped for now. See: https://codeberg.org/ziglang/zig/issues/30976
mihael force-pushed libzigc/math-functions from 2aadb5fed9
Some checks failed
ci / x86_64-netbsd-release (pull_request) Failing after 31m59s
ci / x86_64-netbsd-debug (pull_request) Failing after 50m1s
ci / x86_64-freebsd-release (pull_request) Successful in 51m29s
ci / x86_64-windows-release (pull_request) Failing after 57m38s
ci / x86_64-freebsd-debug (pull_request) Successful in 1h1m14s
ci / x86_64-openbsd-release (pull_request) Successful in 1h14m47s
ci / x86_64-linux-debug (pull_request) Successful in 1h15m42s
ci / x86_64-openbsd-debug (pull_request) Successful in 1h22m58s
ci / s390x-linux-release (pull_request) Successful in 1h23m57s
ci / aarch64-macos-release (pull_request) Successful in 1h25m12s
ci / aarch64-linux-release (pull_request) Successful in 1h29m22s
ci / x86_64-windows-debug (pull_request) Failing after 1h32m14s
ci / aarch64-macos-debug (pull_request) Successful in 1h35m34s
ci / powerpc64le-linux-release (pull_request) Failing after 1h36m27s
ci / aarch64-linux-debug (pull_request) Successful in 2h28m42s
ci / s390x-linux-debug (pull_request) Successful in 2h29m3s
ci / x86_64-linux-debug-llvm (pull_request) Successful in 2h33m24s
ci / x86_64-linux-release (pull_request) Successful in 2h40m25s
ci / powerpc64le-linux-debug (pull_request) Failing after 3h42m41s
ci / loongarch64-linux-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-release (pull_request) Has been cancelled
ci / aarch64-netbsd-debug (pull_request) Has been cancelled
ci / aarch64-netbsd-release (pull_request) Has been cancelled
ci / loongarch64-linux-release (pull_request) Has been cancelled
ci / riscv64-linux-debug (pull_request) Has been cancelled
ci / riscv64-linux-release (pull_request) Has been cancelled
to f5f3670a2a
Some checks failed
ci / aarch64-netbsd-release (pull_request) Waiting to run
ci / riscv64-linux-debug (pull_request) Waiting to run
ci / riscv64-linux-release (pull_request) Waiting to run
ci / x86_64-netbsd-release (pull_request) Failing after 28m38s
ci / x86_64-freebsd-release (pull_request) Successful in 36m5s
ci / x86_64-netbsd-debug (pull_request) Failing after 38m51s
ci / x86_64-freebsd-debug (pull_request) Successful in 47m29s
ci / x86_64-openbsd-release (pull_request) Successful in 53m20s
ci / x86_64-windows-release (pull_request) Successful in 54m36s
ci / aarch64-macos-release (pull_request) Successful in 59m45s
ci / x86_64-linux-debug (pull_request) Successful in 1h3m7s
ci / x86_64-openbsd-debug (pull_request) Successful in 1h3m1s
ci / powerpc64le-linux-release (pull_request) Failing after 1h7m26s
ci / aarch64-macos-debug (pull_request) Successful in 1h10m28s
ci / x86_64-windows-debug (pull_request) Successful in 1h11m45s
ci / s390x-linux-release (pull_request) Successful in 1h24m9s
ci / aarch64-linux-release (pull_request) Successful in 1h28m56s
ci / x86_64-linux-release (pull_request) Failing after 2h17m25s
ci / s390x-linux-debug (pull_request) Successful in 2h21m19s
ci / x86_64-linux-debug-llvm (pull_request) Failing after 2h37m15s
ci / aarch64-linux-debug (pull_request) Successful in 2h41m17s
ci / powerpc64le-linux-debug (pull_request) Failing after 3h4m47s
ci / loongarch64-linux-debug (pull_request) Successful in 3h2m9s
ci / loongarch64-linux-release (pull_request) Successful in 1h45m32s
ci / aarch64-freebsd-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-release (pull_request) Has been cancelled
ci / aarch64-netbsd-debug (pull_request) Has been cancelled
2026年04月19日 11:42:26 +02:00
Compare
mihael force-pushed libzigc/math-functions from f5f3670a2a
Some checks failed
ci / aarch64-netbsd-release (pull_request) Waiting to run
ci / riscv64-linux-debug (pull_request) Waiting to run
ci / riscv64-linux-release (pull_request) Waiting to run
ci / x86_64-netbsd-release (pull_request) Failing after 28m38s
ci / x86_64-freebsd-release (pull_request) Successful in 36m5s
ci / x86_64-netbsd-debug (pull_request) Failing after 38m51s
ci / x86_64-freebsd-debug (pull_request) Successful in 47m29s
ci / x86_64-openbsd-release (pull_request) Successful in 53m20s
ci / x86_64-windows-release (pull_request) Successful in 54m36s
ci / aarch64-macos-release (pull_request) Successful in 59m45s
ci / x86_64-linux-debug (pull_request) Successful in 1h3m7s
ci / x86_64-openbsd-debug (pull_request) Successful in 1h3m1s
ci / powerpc64le-linux-release (pull_request) Failing after 1h7m26s
ci / aarch64-macos-debug (pull_request) Successful in 1h10m28s
ci / x86_64-windows-debug (pull_request) Successful in 1h11m45s
ci / s390x-linux-release (pull_request) Successful in 1h24m9s
ci / aarch64-linux-release (pull_request) Successful in 1h28m56s
ci / x86_64-linux-release (pull_request) Failing after 2h17m25s
ci / s390x-linux-debug (pull_request) Successful in 2h21m19s
ci / x86_64-linux-debug-llvm (pull_request) Failing after 2h37m15s
ci / aarch64-linux-debug (pull_request) Successful in 2h41m17s
ci / powerpc64le-linux-debug (pull_request) Failing after 3h4m47s
ci / loongarch64-linux-debug (pull_request) Successful in 3h2m9s
ci / loongarch64-linux-release (pull_request) Successful in 1h45m32s
ci / aarch64-freebsd-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-release (pull_request) Has been cancelled
ci / aarch64-netbsd-debug (pull_request) Has been cancelled
to d609e728be
Some checks failed
ci / x86_64-netbsd-debug (pull_request) Failing after 47m20s
ci / x86_64-netbsd-release (pull_request) Failing after 38m47s
ci / x86_64-freebsd-debug (pull_request) Successful in 57m33s
ci / aarch64-macos-release (pull_request) Successful in 1h8m28s
ci / x86_64-freebsd-release (pull_request) Successful in 35m49s
ci / aarch64-macos-debug (pull_request) Successful in 1h21m57s
ci / aarch64-linux-release (pull_request) Successful in 1h33m43s
ci / x86_64-openbsd-release (pull_request) Successful in 1h2m7s
ci / x86_64-openbsd-debug (pull_request) Successful in 1h7m29s
ci / x86_64-linux-debug (pull_request) Successful in 1h31m6s
ci / x86_64-windows-release (pull_request) Successful in 1h18m13s
ci / aarch64-linux-debug (pull_request) Successful in 2h32m18s
ci / x86_64-windows-debug (pull_request) Successful in 1h42m25s
ci / s390x-linux-release (pull_request) Successful in 1h58m27s
ci / x86_64-linux-release (pull_request) Successful in 2h23m55s
ci / s390x-linux-debug (pull_request) Successful in 2h34m46s
ci / x86_64-linux-debug-llvm (pull_request) Successful in 3h6m5s
ci / powerpc64le-linux-debug (pull_request) Successful in 4h12m56s
ci / powerpc64le-linux-release (pull_request) Successful in 1h26m56s
ci / loongarch64-linux-release (pull_request) Successful in 2h1m18s
ci / loongarch64-linux-debug (pull_request) Successful in 3h17m12s
ci / aarch64-freebsd-release (pull_request) Has been cancelled
ci / aarch64-netbsd-debug (pull_request) Has been cancelled
ci / aarch64-netbsd-release (pull_request) Has been cancelled
ci / riscv64-linux-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-debug (pull_request) Has been cancelled
ci / riscv64-linux-release (pull_request) Has been cancelled
2026年04月19日 22:16:14 +02:00
Compare
mihael force-pushed libzigc/math-functions from d609e728be
Some checks failed
ci / x86_64-netbsd-debug (pull_request) Failing after 47m20s
ci / x86_64-netbsd-release (pull_request) Failing after 38m47s
ci / x86_64-freebsd-debug (pull_request) Successful in 57m33s
ci / aarch64-macos-release (pull_request) Successful in 1h8m28s
ci / x86_64-freebsd-release (pull_request) Successful in 35m49s
ci / aarch64-macos-debug (pull_request) Successful in 1h21m57s
ci / aarch64-linux-release (pull_request) Successful in 1h33m43s
ci / x86_64-openbsd-release (pull_request) Successful in 1h2m7s
ci / x86_64-openbsd-debug (pull_request) Successful in 1h7m29s
ci / x86_64-linux-debug (pull_request) Successful in 1h31m6s
ci / x86_64-windows-release (pull_request) Successful in 1h18m13s
ci / aarch64-linux-debug (pull_request) Successful in 2h32m18s
ci / x86_64-windows-debug (pull_request) Successful in 1h42m25s
ci / s390x-linux-release (pull_request) Successful in 1h58m27s
ci / x86_64-linux-release (pull_request) Successful in 2h23m55s
ci / s390x-linux-debug (pull_request) Successful in 2h34m46s
ci / x86_64-linux-debug-llvm (pull_request) Successful in 3h6m5s
ci / powerpc64le-linux-debug (pull_request) Successful in 4h12m56s
ci / powerpc64le-linux-release (pull_request) Successful in 1h26m56s
ci / loongarch64-linux-release (pull_request) Successful in 2h1m18s
ci / loongarch64-linux-debug (pull_request) Successful in 3h17m12s
ci / aarch64-freebsd-release (pull_request) Has been cancelled
ci / aarch64-netbsd-debug (pull_request) Has been cancelled
ci / aarch64-netbsd-release (pull_request) Has been cancelled
ci / riscv64-linux-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-debug (pull_request) Has been cancelled
ci / riscv64-linux-release (pull_request) Has been cancelled
to 6a1c7ca58f
Some checks are pending
ci / aarch64-freebsd-debug (pull_request) Waiting to run
ci / aarch64-freebsd-release (pull_request) Waiting to run
ci / aarch64-linux-debug (pull_request) Waiting to run
ci / aarch64-linux-release (pull_request) Waiting to run
ci / aarch64-netbsd-debug (pull_request) Waiting to run
ci / aarch64-netbsd-release (pull_request) Waiting to run
ci / aarch64-macos-debug (pull_request) Waiting to run
ci / aarch64-macos-release (pull_request) Waiting to run
ci / loongarch64-linux-debug (pull_request) Waiting to run
ci / loongarch64-linux-release (pull_request) Waiting to run
ci / powerpc64le-linux-debug (pull_request) Waiting to run
ci / powerpc64le-linux-release (pull_request) Waiting to run
ci / riscv64-linux-debug (pull_request) Waiting to run
ci / riscv64-linux-release (pull_request) Waiting to run
ci / s390x-linux-debug (pull_request) Waiting to run
ci / s390x-linux-release (pull_request) Waiting to run
ci / x86_64-freebsd-debug (pull_request) Waiting to run
ci / x86_64-freebsd-release (pull_request) Waiting to run
ci / x86_64-linux-debug (pull_request) Waiting to run
ci / x86_64-linux-debug-llvm (pull_request) Waiting to run
ci / x86_64-linux-release (pull_request) Waiting to run
ci / x86_64-netbsd-debug (pull_request) Waiting to run
ci / x86_64-netbsd-release (pull_request) Waiting to run
ci / x86_64-openbsd-debug (pull_request) Waiting to run
ci / x86_64-openbsd-release (pull_request) Waiting to run
ci / x86_64-windows-debug (pull_request) Waiting to run
ci / x86_64-windows-release (pull_request) Waiting to run
2026年04月22日 02:25:56 +02:00
Compare
mihael force-pushed libzigc/math-functions from 6a1c7ca58f
Some checks are pending
ci / aarch64-freebsd-debug (pull_request) Waiting to run
ci / aarch64-freebsd-release (pull_request) Waiting to run
ci / aarch64-linux-debug (pull_request) Waiting to run
ci / aarch64-linux-release (pull_request) Waiting to run
ci / aarch64-netbsd-debug (pull_request) Waiting to run
ci / aarch64-netbsd-release (pull_request) Waiting to run
ci / aarch64-macos-debug (pull_request) Waiting to run
ci / aarch64-macos-release (pull_request) Waiting to run
ci / loongarch64-linux-debug (pull_request) Waiting to run
ci / loongarch64-linux-release (pull_request) Waiting to run
ci / powerpc64le-linux-debug (pull_request) Waiting to run
ci / powerpc64le-linux-release (pull_request) Waiting to run
ci / riscv64-linux-debug (pull_request) Waiting to run
ci / riscv64-linux-release (pull_request) Waiting to run
ci / s390x-linux-debug (pull_request) Waiting to run
ci / s390x-linux-release (pull_request) Waiting to run
ci / x86_64-freebsd-debug (pull_request) Waiting to run
ci / x86_64-freebsd-release (pull_request) Waiting to run
ci / x86_64-linux-debug (pull_request) Waiting to run
ci / x86_64-linux-debug-llvm (pull_request) Waiting to run
ci / x86_64-linux-release (pull_request) Waiting to run
ci / x86_64-netbsd-debug (pull_request) Waiting to run
ci / x86_64-netbsd-release (pull_request) Waiting to run
ci / x86_64-openbsd-debug (pull_request) Waiting to run
ci / x86_64-openbsd-release (pull_request) Waiting to run
ci / x86_64-windows-debug (pull_request) Waiting to run
ci / x86_64-windows-release (pull_request) Waiting to run
to 2518a68e49
Some checks failed
ci / aarch64-freebsd-debug (pull_request) Waiting to run
ci / aarch64-freebsd-release (pull_request) Waiting to run
ci / aarch64-netbsd-debug (pull_request) Waiting to run
ci / aarch64-netbsd-release (pull_request) Waiting to run
ci / riscv64-linux-debug (pull_request) Waiting to run
ci / riscv64-linux-release (pull_request) Waiting to run
ci / x86_64-netbsd-release (pull_request) Failing after 30m40s
ci / x86_64-freebsd-release (pull_request) Successful in 46m32s
ci / x86_64-netbsd-debug (pull_request) Failing after 50m35s
ci / powerpc64le-linux-release (pull_request) Failing after 1h33m28s
ci / x86_64-freebsd-debug (pull_request) Successful in 1h2m8s
ci / aarch64-macos-release (pull_request) Successful in 1h38m1s
ci / aarch64-macos-debug (pull_request) Successful in 2h5m48s
ci / aarch64-linux-release (pull_request) Successful in 1h34m33s
ci / powerpc64le-linux-debug (pull_request) Failing after 2h30m14s
ci / aarch64-linux-debug (pull_request) Successful in 2h19m2s
ci / x86_64-openbsd-release (pull_request) Successful in 1h11m7s
ci / x86_64-windows-release (pull_request) Successful in 1h6m56s
ci / x86_64-openbsd-debug (pull_request) Successful in 1h15m37s
ci / x86_64-windows-debug (pull_request) Successful in 1h33m23s
ci / x86_64-linux-debug (pull_request) Successful in 1h54m15s
ci / x86_64-linux-release (pull_request) Failing after 2h44m52s
ci / x86_64-linux-debug-llvm (pull_request) Failing after 3h56m23s
ci / s390x-linux-release (pull_request) Successful in 1h46m37s
ci / s390x-linux-debug (pull_request) Successful in 2h59m1s
ci / loongarch64-linux-release (pull_request) Successful in 2h8m26s
ci / loongarch64-linux-debug (pull_request) Successful in 3h22m11s
2026年04月22日 02:26:27 +02:00
Compare
lib/c/math.zig Outdated
@ -367,0 +377,4 @@
// Epsilons taken from `//arch/${ARCH}/bits/float.h` in musl repo
// https://git.musl-libc.org/cgit/musl/tree/arch
// Covers the architectures listed in CI
Owner
Copy link

Architectures that have @sizeOf(c_longdouble) > 64:

  • aarch64, aarch64_be
  • loongarch64
  • m68k (caveat: #30972)
  • mips64, mips64el
  • riscv32
  • riscv64
  • s390x
  • x86
  • x86_64
Architectures that have `@sizeOf(c_longdouble) > 64`: * `aarch64`, `aarch64_be` * `loongarch64` * `m68k` (caveat: https://codeberg.org/ziglang/zig/issues/30972) * `mips64`, `mips64el` * `riscv32` * `riscv64` * `s390x` * `x86` * `x86_64`
Author
Contributor
Copy link

Thanks, it was a bit of a Hail Mary effort to see if it would help with NetBSD & PowerPC, but it seems like I'll have to dig deeper and perhaps set up a NetBSD environment so I can test. I'll leave the skips for PowerPC since it's a bit peculiar, as you noted.

I added a skip for the -0.3 test on NetBSD just to see if anything else fails on CI in the meantime (since I was going to push to revert the last commit and add 2 more test cases anyways):

if(builtin.target.os.tag!=.netbsd){// somehow rounds to -0.5 on netbsd// Small negative numbers round to negative zerotryexpectEqual(@as(T,-0.0),f(-0.3));}
Thanks, it was a bit of a Hail Mary effort to see if it would help with NetBSD & PowerPC, but it seems like I'll have to dig deeper and perhaps set up a NetBSD environment so I can test. I'll leave the skips for PowerPC since it's a bit peculiar, as you noted. I added a skip for the `-0.3` test on NetBSD just to see if anything else fails on CI in the meantime (since I was going to push to revert the last commit and add 2 more test cases anyways): ```zig if (builtin.target.os.tag != .netbsd) { // somehow rounds to -0.5 on netbsd // Small negative numbers round to negative zero try expectEqual(@as(T, -0.0), f(-0.3)); } ```
mihael force-pushed libzigc/math-functions from 2518a68e49
Some checks failed
ci / aarch64-freebsd-debug (pull_request) Waiting to run
ci / aarch64-freebsd-release (pull_request) Waiting to run
ci / aarch64-netbsd-debug (pull_request) Waiting to run
ci / aarch64-netbsd-release (pull_request) Waiting to run
ci / riscv64-linux-debug (pull_request) Waiting to run
ci / riscv64-linux-release (pull_request) Waiting to run
ci / x86_64-netbsd-release (pull_request) Failing after 30m40s
ci / x86_64-freebsd-release (pull_request) Successful in 46m32s
ci / x86_64-netbsd-debug (pull_request) Failing after 50m35s
ci / powerpc64le-linux-release (pull_request) Failing after 1h33m28s
ci / x86_64-freebsd-debug (pull_request) Successful in 1h2m8s
ci / aarch64-macos-release (pull_request) Successful in 1h38m1s
ci / aarch64-macos-debug (pull_request) Successful in 2h5m48s
ci / aarch64-linux-release (pull_request) Successful in 1h34m33s
ci / powerpc64le-linux-debug (pull_request) Failing after 2h30m14s
ci / aarch64-linux-debug (pull_request) Successful in 2h19m2s
ci / x86_64-openbsd-release (pull_request) Successful in 1h11m7s
ci / x86_64-windows-release (pull_request) Successful in 1h6m56s
ci / x86_64-openbsd-debug (pull_request) Successful in 1h15m37s
ci / x86_64-windows-debug (pull_request) Successful in 1h33m23s
ci / x86_64-linux-debug (pull_request) Successful in 1h54m15s
ci / x86_64-linux-release (pull_request) Failing after 2h44m52s
ci / x86_64-linux-debug-llvm (pull_request) Failing after 3h56m23s
ci / s390x-linux-release (pull_request) Successful in 1h46m37s
ci / s390x-linux-debug (pull_request) Successful in 2h59m1s
ci / loongarch64-linux-release (pull_request) Successful in 2h8m26s
ci / loongarch64-linux-debug (pull_request) Successful in 3h22m11s
to 7fbddebb0e
Some checks failed
ci / x86_64-netbsd-release (pull_request) Failing after 28m41s
ci / aarch64-macos-release (pull_request) Successful in 41m47s
ci / x86_64-netbsd-debug (pull_request) Failing after 40m37s
ci / x86_64-freebsd-debug (pull_request) Successful in 49m18s
ci / aarch64-macos-debug (pull_request) Successful in 1h21m3s
ci / x86_64-openbsd-release (pull_request) Successful in 51m34s
ci / x86_64-windows-release (pull_request) Successful in 1h3m54s
ci / x86_64-openbsd-debug (pull_request) Successful in 1h0m17s
ci / aarch64-linux-release (pull_request) Successful in 1h29m25s
ci / x86_64-windows-debug (pull_request) Successful in 1h16m31s
ci / powerpc64le-linux-release (pull_request) Successful in 1h41m40s
ci / x86_64-linux-debug (pull_request) Successful in 1h37m42s
ci / aarch64-linux-debug (pull_request) Successful in 2h40m8s
ci / powerpc64le-linux-debug (pull_request) Successful in 3h9m46s
ci / x86_64-linux-release (pull_request) Successful in 2h44m53s
ci / x86_64-linux-debug-llvm (pull_request) Successful in 3h11m27s
ci / x86_64-freebsd-release (pull_request) Successful in 38m53s
ci / s390x-linux-release (pull_request) Successful in 3h39m8s
ci / loongarch64-linux-release (pull_request) Successful in 2h19m56s
ci / loongarch64-linux-debug (pull_request) Successful in 3h51m51s
ci / aarch64-freebsd-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-release (pull_request) Has been cancelled
ci / aarch64-netbsd-debug (pull_request) Has been cancelled
ci / aarch64-netbsd-release (pull_request) Has been cancelled
ci / riscv64-linux-debug (pull_request) Has been cancelled
ci / riscv64-linux-release (pull_request) Has been cancelled
ci / s390x-linux-debug (pull_request) Successful in 4h26m31s
2026年04月22日 17:24:11 +02:00
Compare
mihael force-pushed libzigc/math-functions from 7fbddebb0e
Some checks failed
ci / x86_64-netbsd-release (pull_request) Failing after 28m41s
ci / aarch64-macos-release (pull_request) Successful in 41m47s
ci / x86_64-netbsd-debug (pull_request) Failing after 40m37s
ci / x86_64-freebsd-debug (pull_request) Successful in 49m18s
ci / aarch64-macos-debug (pull_request) Successful in 1h21m3s
ci / x86_64-openbsd-release (pull_request) Successful in 51m34s
ci / x86_64-windows-release (pull_request) Successful in 1h3m54s
ci / x86_64-openbsd-debug (pull_request) Successful in 1h0m17s
ci / aarch64-linux-release (pull_request) Successful in 1h29m25s
ci / x86_64-windows-debug (pull_request) Successful in 1h16m31s
ci / powerpc64le-linux-release (pull_request) Successful in 1h41m40s
ci / x86_64-linux-debug (pull_request) Successful in 1h37m42s
ci / aarch64-linux-debug (pull_request) Successful in 2h40m8s
ci / powerpc64le-linux-debug (pull_request) Successful in 3h9m46s
ci / x86_64-linux-release (pull_request) Successful in 2h44m53s
ci / x86_64-linux-debug-llvm (pull_request) Successful in 3h11m27s
ci / x86_64-freebsd-release (pull_request) Successful in 38m53s
ci / s390x-linux-release (pull_request) Successful in 3h39m8s
ci / loongarch64-linux-release (pull_request) Successful in 2h19m56s
ci / loongarch64-linux-debug (pull_request) Successful in 3h51m51s
ci / aarch64-freebsd-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-release (pull_request) Has been cancelled
ci / aarch64-netbsd-debug (pull_request) Has been cancelled
ci / aarch64-netbsd-release (pull_request) Has been cancelled
ci / riscv64-linux-debug (pull_request) Has been cancelled
ci / riscv64-linux-release (pull_request) Has been cancelled
ci / s390x-linux-debug (pull_request) Successful in 4h26m31s
to 7f4d9423e8
Some checks failed
ci / x86_64-netbsd-release (pull_request) Failing after 35m2s
ci / x86_64-netbsd-debug (pull_request) Failing after 37m15s
ci / x86_64-freebsd-release (pull_request) Successful in 39m21s
ci / x86_64-freebsd-debug (pull_request) Successful in 48m11s
ci / x86_64-openbsd-release (pull_request) Successful in 48m41s
ci / x86_64-linux-debug (pull_request) Successful in 50m11s
ci / x86_64-windows-release (pull_request) Successful in 50m26s
ci / x86_64-openbsd-debug (pull_request) Successful in 54m48s
ci / aarch64-macos-release (pull_request) Successful in 56m45s
ci / x86_64-windows-debug (pull_request) Successful in 56m48s
ci / aarch64-linux-debug (pull_request) Has been cancelled
ci / aarch64-linux-release (pull_request) Has been cancelled
ci / loongarch64-linux-debug (pull_request) Has been cancelled
ci / loongarch64-linux-release (pull_request) Has been cancelled
ci / aarch64-macos-debug (pull_request) Has been cancelled
ci / x86_64-linux-debug-llvm (pull_request) Has been cancelled
ci / x86_64-linux-release (pull_request) Has been cancelled
ci / powerpc64le-linux-release (pull_request) Has been cancelled
ci / s390x-linux-debug (pull_request) Has been cancelled
ci / powerpc64le-linux-debug (pull_request) Has been cancelled
ci / s390x-linux-release (pull_request) Has been cancelled
ci / aarch64-freebsd-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-release (pull_request) Has been cancelled
ci / aarch64-netbsd-debug (pull_request) Has been cancelled
ci / aarch64-netbsd-release (pull_request) Has been cancelled
ci / riscv64-linux-debug (pull_request) Has been cancelled
ci / riscv64-linux-release (pull_request) Has been cancelled
2026年04月25日 03:21:14 +02:00
Compare
mihael force-pushed libzigc/math-functions from 4698f375d8
Some checks failed
ci / aarch64-freebsd-debug (pull_request) Waiting to run
ci / aarch64-freebsd-release (pull_request) Waiting to run
ci / aarch64-netbsd-debug (pull_request) Waiting to run
ci / aarch64-netbsd-release (pull_request) Waiting to run
ci / riscv64-linux-debug (pull_request) Waiting to run
ci / riscv64-linux-release (pull_request) Waiting to run
ci / x86_64-netbsd-release (pull_request) Failing after 25m52s
ci / x86_64-netbsd-debug (pull_request) Failing after 41m58s
ci / x86_64-freebsd-debug (pull_request) Successful in 47m42s
ci / x86_64-openbsd-release (pull_request) Successful in 51m53s
ci / x86_64-windows-release (pull_request) Successful in 53m45s
ci / aarch64-macos-release (pull_request) Successful in 59m43s
ci / x86_64-openbsd-debug (pull_request) Successful in 1h1m3s
ci / x86_64-linux-debug (pull_request) Successful in 1h8m28s
ci / x86_64-windows-debug (pull_request) Successful in 1h23m32s
ci / aarch64-macos-debug (pull_request) Successful in 1h25m5s
ci / aarch64-linux-release (pull_request) Successful in 1h27m43s
ci / x86_64-freebsd-release (pull_request) Successful in 48m20s
ci / powerpc64le-linux-release (pull_request) Successful in 1h48m22s
ci / loongarch64-linux-release (pull_request) Successful in 1h55m26s
ci / aarch64-linux-debug (pull_request) Successful in 2h22m7s
ci / s390x-linux-release (pull_request) Successful in 3h7m53s
ci / loongarch64-linux-debug (pull_request) Successful in 3h9m24s
ci / powerpc64le-linux-debug (pull_request) Successful in 3h12m57s
ci / x86_64-linux-release (pull_request) Successful in 3h23m5s
ci / x86_64-linux-debug-llvm (pull_request) Successful in 3h26m23s
ci / s390x-linux-debug (pull_request) Successful in 4h13m23s
to f8a1983f74
All checks were successful
ci / x86_64-freebsd-release (pull_request) Successful in 35m50s
ci / x86_64-netbsd-release (pull_request) Successful in 35m42s
ci / aarch64-macos-release (pull_request) Successful in 37m6s
ci / x86_64-netbsd-debug (pull_request) Successful in 45m59s
ci / x86_64-freebsd-debug (pull_request) Successful in 49m10s
ci / x86_64-windows-release (pull_request) Successful in 51m18s
ci / x86_64-openbsd-release (pull_request) Successful in 52m49s
ci / x86_64-openbsd-debug (pull_request) Successful in 54m48s
ci / x86_64-windows-debug (pull_request) Successful in 1h4m41s
ci / x86_64-linux-debug (pull_request) Successful in 1h26m5s
ci / powerpc64le-linux-release (pull_request) Successful in 1h26m34s
ci / aarch64-linux-release (pull_request) Successful in 1h28m23s
ci / x86_64-linux-release (pull_request) Successful in 1h49m18s
ci / loongarch64-linux-release (pull_request) Successful in 1h52m28s
ci / aarch64-linux-debug (pull_request) Successful in 2h35m47s
ci / x86_64-linux-debug-llvm (pull_request) Successful in 2h38m24s
ci / loongarch64-linux-debug (pull_request) Successful in 2h48m29s
ci / powerpc64le-linux-debug (pull_request) Successful in 3h4m28s
ci / s390x-linux-release (pull_request) Successful in 1h53m5s
ci / s390x-linux-debug (pull_request) Successful in 2h57m22s
ci / aarch64-macos-debug (pull_request) Successful in 1h13m51s
ci / aarch64-freebsd-debug (pull_request) Successful in 4h19m17s
ci / aarch64-freebsd-release (pull_request) Successful in 2h55m12s
ci / aarch64-netbsd-debug (pull_request) Successful in 3h40m18s
ci / aarch64-netbsd-release (pull_request) Successful in 2h55m50s
ci / riscv64-linux-debug (pull_request) Has been skipped
ci / riscv64-linux-release (pull_request) Has been skipped
2026年04月25日 22:01:34 +02:00
Compare
Author
Contributor
Copy link

This should be it. I've skipped the rintl tests on PowerPC and referenced the issue (#30976) in the comment. I'm also skipping, but documenting with TODO, the two test cases (floats close to -n.5 rounding to -n.5) that fail on NetBSD. Since libzigc is not being built for NetBSD, it would seem it's a bug in their native libc -- I guess.

This should be it. I've skipped the `rintl` tests on PowerPC and referenced the issue (#30976) in the comment. I'm also skipping, but documenting with `TODO`, the two test cases (floats close to `-n.5` rounding to `-n.5`) that fail on NetBSD. Since `libzigc` is not being built for NetBSD, it would seem it's a bug in their native libc -- I guess.
mihael deleted branch libzigc/math-functions 2026年04月28日 00:21:39 +02:00
Sign in to join this conversation.
No reviewers
Labels
Clear labels
abi/f32
abi/ilp32
abi/sf
accepted
This proposal is planned.
arch/21k
arch/6502
arch/aarch64
arch/alpha
arch/amdgcn
arch/arc
arch/arc32
arch/arc64
arch/arm
arch/avr
arch/bfin
arch/bpf
arch/colossus
arch/cris
arch/csky
arch/dlx
arch/epiphany
arch/fr30
arch/frv
arch/hexagon
arch/hppa
arch/hppa64
arch/ia64
arch/kalimba
arch/kvx
arch/lanai
arch/lm32
arch/loongarch32
arch/loongarch64
arch/m32r
arch/m68k
arch/m88k
arch/mcore
arch/microblaze
arch/mips
arch/mips64
arch/mmix
arch/moxie
arch/mrisc32
arch/msp430
arch/nds32
arch/ns32k
arch/nvptx
arch/or1k
arch/powerpc
arch/powerpc64
arch/propeller
arch/riscv32
arch/riscv64
arch/rl78
arch/rx
arch/s390x
arch/sh
arch/sparc
arch/sparc64
arch/spirv
arch/spu
arch/tricore
arch/v850
arch/vax
arch/vc4
arch/ve
arch/wasm
arch/x86
arch/x86_64
arch/xcore
arch/xtensa
autodoc
The web application for interactive documentation and generation of its assets.
backend/c
The C backend outputs C source code.
backend/llvm
The LLVM backend outputs an LLVM bitcode module.
backend/self-hosted
The self-hosted backends produce machine code directly.
binutils
Zig's included binary utilities: zig ar, zig dlltool, zig lib, zig ranlib, zig objcopy, and zig rc.
breaking
Implementing this issue could cause existing code to no longer compile or have different behavior.
build system
The Zig build system - zig build, std.Build, the build runner, and package management.
debug info
An issue related to debug information (e.g. DWARF) produced by the Zig compiler.
docs
An issue with documentation, e.g. the language reference or standard library doc comments.
error message
This issue points out an error message that is unhelpful and should be improved.
frontend
Tokenization, parsing, AstGen, ZonGen, Sema, Legalize, and Liveness.
fuzzing
An issue related to Zig's integrated fuzz testing.
incremental
Reuse of internal compiler state for faster compilation.
lib/c
This issue relates to Zig's libc implementation and/or vendored libcs.
lib/compiler-rt
This issue relates to Zig's compiler-rt library.
lib/cxx
This issue relates to Zig's vendored libc++ and/or libc++abi.
lib/std
This issue relates to Zig's standard library.
lib/tsan
This issue relates to Zig's vendored libtsan.
lib/ubsan-rt
This issue relates to Zig's ubsan-rt library.
lib/unwind
This issue relates to Zig's vendored libunwind.
linking
Zig's integrated object file and incremental linker.
miscompilation
The compiler reports success but produces semantically incorrect code.
os/android
os/contiki
os/dragonfly
os/driverkit
os/emscripten
os/freebsd
os/fuchsia
os/haiku
os/hermit
os/hurd
os/illumos
os/ios
os/linux
os/maccatalyst
os/macos
os/managarm
os/netbsd
os/ohos
os/openbsd
os/plan9
os/redox
os/rtems
os/serenity
os/tvos
os/uefi
os/visionos
os/wasi
os/watchos
os/windows
proposal
This issue suggests language modifications. If it also has the "accepted" label then it is planned.
release notes
This issue or pull request should be mentioned in the release notes.
testing
This issue is related to testing the compiler, standard library, or other parts of Zig.
zig cc
Zig as a drop-in C-family compiler.
zig fmt
The Zig source code formatter.
zig reduce
The Zig source code reduction tool.
bounty
https://ziglang.org/news/announcing-donor-bounties
bug
Observed behavior contradicts documented or intended behavior.
contributor-friendly
This issue is limited in scope and/or knowledge of project internals.
downstream
An issue with a third-party project that uses this project.
enhancement
Solving this issue will likely involve adding new logic or components to the codebase.
infra
An issue related to project infrastructure, e.g. continuous integration.
optimization
A task to improve performance and/or resource usage.
question
No questions on the issue tracker; use a community space instead.
regression
Something that used to work in a previous version stopped working
upstream
An issue with a third-party project that this project uses.
use case
Describes a real use case that is difficult or impossible, but does not propose a solution.
No labels
abi/f32
abi/ilp32
abi/sf
accepted
arch/21k
arch/6502
arch/aarch64
arch/alpha
arch/amdgcn
arch/arc
arch/arc32
arch/arc64
arch/arm
arch/avr
arch/bfin
arch/bpf
arch/colossus
arch/cris
arch/csky
arch/dlx
arch/epiphany
arch/fr30
arch/frv
arch/hexagon
arch/hppa
arch/hppa64
arch/ia64
arch/kalimba
arch/kvx
arch/lanai
arch/lm32
arch/loongarch32
arch/loongarch64
arch/m32r
arch/m68k
arch/m88k
arch/mcore
arch/microblaze
arch/mips
arch/mips64
arch/mmix
arch/moxie
arch/mrisc32
arch/msp430
arch/nds32
arch/ns32k
arch/nvptx
arch/or1k
arch/powerpc
arch/powerpc64
arch/propeller
arch/riscv32
arch/riscv64
arch/rl78
arch/rx
arch/s390x
arch/sh
arch/sparc
arch/sparc64
arch/spirv
arch/spu
arch/tricore
arch/v850
arch/vax
arch/vc4
arch/ve
arch/wasm
arch/x86
arch/x86_64
arch/xcore
arch/xtensa
autodoc
backend/c
backend/llvm
backend/self-hosted
binutils
breaking
build system
debug info
docs
error message
frontend
fuzzing
incremental
lib/c
lib/compiler-rt
lib/cxx
lib/std
lib/tsan
lib/ubsan-rt
lib/unwind
linking
miscompilation
os/android
os/contiki
os/dragonfly
os/driverkit
os/emscripten
os/freebsd
os/fuchsia
os/haiku
os/hermit
os/hurd
os/illumos
os/ios
os/linux
os/maccatalyst
os/macos
os/managarm
os/netbsd
os/ohos
os/openbsd
os/plan9
os/redox
os/rtems
os/serenity
os/tvos
os/uefi
os/visionos
os/wasi
os/watchos
os/windows
proposal
release notes
testing
zig cc
zig fmt
zig reduce
bounty
bug
contributor-friendly
downstream
enhancement
infra
optimization
question
regression
upstream
use case
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ziglang/zig!31791
Reference in a new issue
ziglang/zig
No description provided.
Delete branch "mihael/zig:libzigc/math-functions"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?