zig/lib/c
Pivok d0b39c7f2b libzigc: hypot (#31104)
First time contribution.

Implements hypot for libzigc #30978.

Commands i run:
```
$ stage3/bin/zig build -p stage4 -Denable-llvm -Dno-lib

$ stage4/bin/zig build test-libc -Dlibc-test-path=../../libc-test -Dtest-filter=hypot --summary line -fqemu -fwasmtime
Build Summary: 725/737 steps succeeded (12 skipped)
```

I also changed std.math.hypot becuase some libc-tests raised fp exceptions. Example:
```
../../libc-test/src/math/special/hypot.h:8: bad fp exception: RN hypot(0x1p-1074,0x0p+0)=0x1p-1074, want 0 got INEXACT|UNDERFLOW
../../libc-test/src/math/special/hypot.h:9: bad fp exception: RN hypot(0x1p-1074,-0x0p+0)=0x1p-1074, want 0 got INEXACT|UNDERFLOW
```

I also run this command as a quick sanity check:
```
$ stage4/bin/zig build test-std -Dtest-filter=hypot -Dtest-target-filter=x86_64-linux-musl --summary line
Build Summary: 5/5 steps succeeded; 136/136 tests passed
```

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31104
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
Co-authored-by: Pivok <pivoc@protonmail.com>
Co-committed-by: Pivok <pivoc@protonmail.com>
2026-02-05 21:57:32 +01:00
..
stdlib feat(libzigc): avoid division/multiplication in drand48 and erand48 2026-01-14 23:48:07 +01:00
sys fix(libzigc): export mincore 2026-01-27 00:06:18 +01:00
common.zig fix(libzigc): always apply strong linkage, even when testing 2026-01-29 10:39:38 +01:00
ctype.zig fix(libzigc): properly handle EOF in ctype 2026-01-13 05:58:41 +01:00
inttypes.zig feat(libzigc): add div, ldiv, lldiv and imaxdiv 2026-01-07 21:53:40 +01:00
math.zig libzigc: hypot (#31104) 2026-02-05 21:57:32 +01:00
stdlib.zig feat(libzigc): implement the drand48 family 2026-01-14 13:14:33 +01:00
string.zig feat(libzigc): use common implementations for strings.h and string.h 2026-01-17 22:37:29 +01:00
strings.zig feat(libzigc): use common implementations for strings.h and string.h 2026-01-17 22:37:29 +01:00
sys.zig feat(libzigc): move over some linux syscalls 2026-01-24 20:41:15 +01:00
unistd.zig libc: reimplement swab in Zig (#31130) 2026-02-05 20:21:41 +01:00
wchar.zig feat(libzigc): add wcstok and reuse more std.mem code 2026-01-17 21:42:40 +01:00