mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-04-27 19:09:47 +03:00
eab22ab2b8
The behaviour regarding special cases differs between `libc` and Zig's `stdlib` for `modf`, so the implementation couldn't be a straightforward calling of `stdlib` function. Other than the obvious documented differences, I also had problems with the `INVALID` flag being raised while running `libc-test` suite on riscv arch through qemu. The solution was to test if the argument is `NaN`, and then return a quiet `NaN` if so. Passing tests, that should include all the special cases to be wary of, were also added. Test results: ``` $ stage4/bin/zig build test-libc -Dlibc-test-path=<LIBC-TEST-PATH> -Dtest-filter=modf -fqemu -fwasmtime --summary line Build Summary: 921/921 steps succeeded ```