summaryrefslogtreecommitdiffstats
path: root/Test
diff options
context:
space:
mode:
authordana <dana@dana.is>2026-04-13 11:04:58 -0500
committerdana <dana@dana.is>2026-04-13 11:07:56 -0500
commitbfb982d6824a41ebff1fc5934ebee7f01df1e682 (patch)
tree4cf710d17dcd411e88f1f5261ed96ec15202c394 /Test
parent54313: convfloat: use consistent capitalisation for NaN, Inf, and -Inf (diff)
downloadzsh-bfb982d6824a41ebff1fc5934ebee7f01df1e682.tar
zsh-bfb982d6824a41ebff1fc5934ebee7f01df1e682.tar.gz
zsh-bfb982d6824a41ebff1fc5934ebee7f01df1e682.tar.bz2
zsh-bfb982d6824a41ebff1fc5934ebee7f01df1e682.tar.lz
zsh-bfb982d6824a41ebff1fc5934ebee7f01df1e682.tar.xz
zsh-bfb982d6824a41ebff1fc5934ebee7f01df1e682.tar.zst
zsh-bfb982d6824a41ebff1fc5934ebee7f01df1e682.zip
54318: mathfunc: add isnan() and isinf(). also document NaN + Inf
Diffstat (limited to 'Test')
-rw-r--r--Test/V03mathfunc.ztst8
1 files changed, 8 insertions, 0 deletions
diff --git a/Test/V03mathfunc.ztst b/Test/V03mathfunc.ztst
index 9a297d69d..8380b5c41 100644
--- a/Test/V03mathfunc.ztst
+++ b/Test/V03mathfunc.ztst
@@ -145,3 +145,11 @@ F:This test fails if your math library doesn't have erand48().
print -r - "$a, $b, $c"
0:log2
>-1.00000, 0.58496, 6.62936
+
+ () {
+ local -F n=nan i1=inf i2=-inf
+ (( isnan(Nan) && isinf(Inf) && isinf(-Inf) )) &&
+ (( isnan(n) && isinf(i1) && isinf(i2) )) &&
+ (( !isnan(Inf) && !isinf(NaN) ))
+ }
+0:isinf, isnan