# libzigc: hypot \(\#31104\) · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/d0b39c7f2b95522c262a92b97bf5654721ace1c7)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: d0b39c7f2b95522c262a92b97bf5654721ace1c7

Requested commit: d0b39c7f2b95522c262a92b97bf5654721ace1c7

Commit: d0b39c7f2b95522c262a92b97bf5654721ace1c7

Tree: 5e2b0a6739be02cb6c61d9b5f23723c298d085a1

Author: Pivok

Committer: Andrew Kelley

## Message

````
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>

````

## Parents

- [c38f9336a3157ae863a795b005db670c6cc04906](https://git.cafe/gitcafe/zig/commit/c38f9336a3157ae863a795b005db670c6cc04906?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/d0b39c7f2b95522c262a92b97bf5654721ace1c7?format=markdown)
