isfinite(f) -> Bool

Test whether a number is finite


  1. Check if a number is finite:

    julia> isfinite(10.5)

    This example checks if the number 10.5 is finite, which returns true.

  2. Verify if a negative number is finite:

    julia> isfinite(-3.2)

    It confirms whether the negative number -3.2 is finite, returning true.

  3. Handle non-finite values like infinity:

    julia> isfinite(Inf)

    This example checks if the value Inf (representing infinity) is finite, which returns false.

  4. Check if a complex number is finite:
    julia> isfinite(2 + 3im)

    It tests whether the complex number 2 + 3im is finite, returning true.

Common mistake example:

julia> isfinite(NaN)

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.

*Required Field

Checking you are not a robot: