isfinite
isfinite(f) -> Bool
Test whether a number is finite
Examples
-
Check if a number is finite:
julia> isfinite(10.5) trueThis example checks if the number
10.5is finite, which returnstrue. -
Verify if a negative number is finite:
julia> isfinite(-3.2) trueIt confirms whether the negative number
-3.2is finite, returningtrue. -
Handle non-finite values like infinity:
julia> isfinite(Inf) falseThis example checks if the value
Inf(representing infinity) is finite, which returnsfalse. - Check if a complex number is finite:
julia> isfinite(2 + 3im) trueIt tests whether the complex number
2 + 3imis finite, returningtrue.
Common mistake example:
julia> isfinite(NaN)
true
In this example, the function returns true for NaN (Not a Number), which might be unexpected. It's important to note that NaN is considered finite in Julia.
See Also
digits, inf, isdigit, iseven, isfinite, isless, islower, isnumber, isodd, isprime, isqrt, issorted, issubnormal, isxdigit, nan,User Contributed Notes
Add a Note
The format of note supported is markdown, use triple backtick to start and end a code block.