authorgravatar for hi@viri.moeviri <hi@viri.moe> 2022-04-08 20:13:30-06:00
committergravatar for hi@viri.moeviri <hi@viri.moe> 2022-04-08 20:13:30-06:00
logf9a9e8ba7375a6e4c7e9fa50902a897387212dbb
treeaeb256ec45edf9e892f56d63a11dc7e897f9cdce
parente46c61250332e615afc5aed6e4ebe57b8e6713eb
signaturelock-open Commit is signed but in an unrecognized format.

std.math.isInf: add tests for +-NaN


1 files changed, 6 insertions(+), 0 deletions(-)

lib/std/math/isinf.zig+6
...@@ -32,6 +32,8 @@ test "math.isInf" {...@@ -32,6 +32,8 @@ test "math.isInf" {
32 try expect(!isInf(@as(T, -0.0)));32 try expect(!isInf(@as(T, -0.0)));
33 try expect(isInf(math.inf(T)));33 try expect(isInf(math.inf(T)));
34 try expect(isInf(-math.inf(T)));34 try expect(isInf(-math.inf(T)));
35 try expect(!isInf(math.nan(T)));
36 try expect(!isInf(-math.nan(T)));
35 }37 }
36}38}
3739
...@@ -44,6 +46,8 @@ test "math.isPositiveInf" {...@@ -44,6 +46,8 @@ test "math.isPositiveInf" {
44 try expect(!isPositiveInf(@as(T, -0.0)));46 try expect(!isPositiveInf(@as(T, -0.0)));
45 try expect(isPositiveInf(math.inf(T)));47 try expect(isPositiveInf(math.inf(T)));
46 try expect(!isPositiveInf(-math.inf(T)));48 try expect(!isPositiveInf(-math.inf(T)));
49 try expect(!isInf(math.nan(T)));
50 try expect(!isInf(-math.nan(T)));
47 }51 }
48}52}
4953
...@@ -56,5 +60,7 @@ test "math.isNegativeInf" {...@@ -56,5 +60,7 @@ test "math.isNegativeInf" {
56 try expect(!isNegativeInf(@as(T, -0.0)));60 try expect(!isNegativeInf(@as(T, -0.0)));
57 try expect(!isNegativeInf(math.inf(T)));61 try expect(!isNegativeInf(math.inf(T)));
58 try expect(isNegativeInf(-math.inf(T)));62 try expect(isNegativeInf(-math.inf(T)));
63 try expect(!isInf(math.nan(T)));
64 try expect(!isInf(-math.nan(T)));
59 }65 }
60}66}