isfinite

isfinite(f) -> Bool

Test whether a number is finite

Examples

  1. Check if a number is finite:

    julia> isfinite(10.5)
    true

    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)
    true

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

  3. Handle non-finite values like infinity:

    julia> isfinite(Inf)
    false

    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)
    true

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

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.

*Required Field
Details

Checking you are not a robot: