Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: return status of the 'let' builtin



> 2026/04/08 3:53、dana <dana@xxxxxxx>のメール:
> 
> (obv if this goes in i will adjust the documentation examples)

It would be better to mention that users can check whether a value
of a parameter $x is NaN or not by
    [[ $x = NaN ]]        # or of course [[ $x = (#i)nan ]]

For Inf, (( x == Inf )), (( x == inf )) or (( x == -Inf)) etc. work,
but (( x == NaN )) is always false as it should be.

In workers/42369 (16 Feb. 2018):
    "zsh/mathfunc should provide an isnan() function"
but there is no isnan() yet. Should we add it now?

Or users can define isnan() by
% __dummy () { [[ $1 = NaN ]] && return 1 || return 0 }
% functions -M isnan 1 1 __dummy





Messages sorted by: Reverse Date, Date, Thread, Author