zig/lib/std/math
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
..
big std.math.big: require sufficient capacity for aliased params 2025-12-27 20:38:33 +01:00
complex std.math.complex: fix cosh/tanh 2024-07-30 20:31:22 +12:00
acos.zig Add f16, f80 and f128 support for acos and asin (#30997) 2026-01-28 23:33:35 +01:00
acosh.zig Change many test blocks to doctests/decltests 2024-02-26 15:18:31 -08:00
asin.zig Add f16, f80 and f128 support for acos and asin (#30997) 2026-01-28 23:33:35 +01:00
asinh.zig Change many test blocks to doctests/decltests 2024-02-26 15:18:31 -08:00
atan.zig Add f16, f80 and f128 support for atan 2026-01-30 06:20:14 +01:00
atan2.zig Change many test blocks to doctests/decltests 2024-02-26 15:18:31 -08:00
atanh.zig Change many test blocks to doctests/decltests 2024-02-26 15:18:31 -08:00
big.zig big.int: implement float conversions 2025-06-15 14:15:18 -04:00
cbrt.zig Change many test blocks to doctests/decltests 2024-02-26 15:18:31 -08:00
complex.zig std.math.complex: Add squared magnitude function (#21998) 2024-11-26 13:03:48 +00:00
copysign.zig std: update std.builtin.Type fields to follow naming conventions 2024-08-28 08:39:59 +01:00
cosh.zig Change many test blocks to doctests/decltests 2024-02-26 15:18:31 -08:00
expm1.zig Make sure to test the sign of the zero results 2025-07-17 05:04:59 +02:00
expo2.zig all: migrate code to new cast builtin syntax 2023-06-24 16:56:39 -07:00
float.zig all: replace all @Type usages 2025-11-22 22:42:38 +00:00
frexp.zig std: update std.builtin.Type fields to follow naming conventions 2024-08-28 08:39:59 +01:00
gamma.zig std: stop relying on precision-losing coercions 2025-07-31 10:57:04 +01:00
gcd.zig std.math: change gcd's implementation to use Stein's algorithm instead of Euclid's (#21077) 2024-09-23 17:15:57 -07:00
hypot.zig libzigc: hypot (#31104) 2026-02-05 21:57:32 +01:00
ilogb.zig std: update std.builtin.Type fields to follow naming conventions 2024-08-28 08:39:59 +01:00
isfinite.zig std: update std.builtin.Type fields to follow naming conventions 2024-08-28 08:39:59 +01:00
isinf.zig std: update std.builtin.Type fields to follow naming conventions 2024-08-28 08:39:59 +01:00
isnan.zig Coff: implement threadlocal variables 2025-10-10 22:47:47 -07:00
isnormal.zig std: update std.builtin.Type fields to follow naming conventions 2024-08-28 08:39:59 +01:00
iszero.zig std: update std.builtin.Type fields to follow naming conventions 2024-08-28 08:39:59 +01:00
lcm.zig std.math: Add least common multiple (lcm) 2025-03-24 16:07:40 +01:00
ldexp.zig std: update std.builtin.Type fields to follow naming conventions 2024-08-28 08:39:59 +01:00
log.zig std: update std.builtin.Type fields to follow naming conventions 2024-08-28 08:39:59 +01:00
log1p.zig Make sure to test the sign of the zero results 2025-07-17 05:04:59 +02:00
log2.zig all: replace all @Type usages 2025-11-22 22:42:38 +00:00
log10.zig std: skip some failing tests on hexagon 2025-08-30 06:36:41 +02:00
log_int.zig all: replace all @Type usages 2025-11-22 22:42:38 +00:00
modf.zig represent Mac Catalyst as aarch64-maccatalyst-none rather than aarch64-ios-macabi 2025-11-14 11:33:35 +01:00
nextafter.zig std.math: rename make_f80 to F80.toFloat and break_f80 to F80.fromFloat 2024-09-02 00:10:22 +03:00
pow.zig std: stop relying on precision-losing coercions 2025-07-31 10:57:04 +01:00
powi.zig Update powi.zig to fix docstring formatting 2025-08-24 22:59:08 +02:00
scalbn.zig Remove redundant test name prefixes now that test names are fully qualified 2024-02-26 15:18:31 -08:00
signbit.zig all: replace all @Type usages 2025-11-22 22:42:38 +00:00
sinh.zig Change many test blocks to doctests/decltests 2024-02-26 15:18:31 -08:00
sqrt.zig all: replace all @Type usages 2025-11-22 22:42:38 +00:00
tanh.zig std.math.tanh: fix special cases comment 2024-12-27 03:12:03 +01:00