Skip to content

missing floatmin, floatmax, issubnormal #114

Description

@stevengj

One would expect the following to be defined for any floating-point type:

julia> x = dec"10.0"
10.0

julia> floatmin(x)
ERROR: MethodError: no method matching floatmin(::Type{Decimal})

julia> floatmax(x)
ERROR: MethodError: no method matching floatmax(::Type{Decimal})

julia> issubnormal(x) # expected result: false
ERROR: MethodError: no method matching issubnormal(::Decimal)

You clearly have a non-trivial floatmin and floatmax because raising to a large power gives an overflow error

julia> (dec"10")^1000000000
ERROR: OverflowError: Exponent limit (999999) exceeded: Decimal(0, 1000000000000000000000000000000000000000000000000000000, 1048522)

and raising a number < 1 to a large power gives the wrong result:

julia> (dec"0.1")^1000000000
0E-1000026

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions