zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 149444723f91761b64576dcb94eaed4782a6151c (tree)
parent e24398361dacc4b995ec67043746561927f5f1d2
Author: Marc Tiehuis <marc@tiehu.is>
Date:   Sun,  5 Dec 2021 22:58:13 +1300

std/math: Add test cases for #9901

Closes #9901.
Closes #9902.

Diffstat:
Mlib/std/math/sin.zig | 10++++++++++
1 file changed, 10 insertions(+), 0 deletions(-)

diff --git a/lib/std/math/sin.zig b/lib/std/math/sin.zig @@ -156,3 +156,13 @@ test "math.sin64.special" { try expect(math.isNan(sin64(-math.inf(f64)))); try expect(math.isNan(sin64(math.nan(f64)))); } + +test "math.sin32 #9901" { + const float = @bitCast(f32, @as(u32, 0b11100011111111110000000000000000)); + _ = std.math.sin(float); +} + +test "math.sin64 #9901" { + const float = @bitCast(f64, @as(u64, 0b1111111101000001000000001111110111111111100000000000000000000001)); + _ = std.math.sin(float); +}