issubnormal

issubnormal(f) -> Bool

Test whether a floating point number is subnormal

Examples

  1. Check if a number is subnormal:

    julia> issubnormal(0.0)
    false

    This example checks if the floating-point number 0.0 is subnormal. The function returns false since 0.0 is not a subnormal number.

  2. Check if a subnormal number is detected:

    julia> issubnormal(1.1754944e-38)
    true

    Here, the function is used to determine if the number 1.1754944e-38 (a subnormal number) is correctly recognized as subnormal. It returns true as expected.

  3. Handle larger numbers that are not subnormal:

    julia> issubnormal(100.0)
    false

    This example demonstrates that even though 100.0 is a finite floating-point number, it is not considered subnormal. The function correctly returns false.

Common mistake example:

julia> issubnormal(42)
ERROR: MethodError: no method matching issubnormal(::Int64)

In this example, the function is called with an argument of type Int64. However, issubnormal is specifically for floating-point numbers and cannot be used with integers. Make sure to provide a floating-point number as an argument to issubnormal.

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: