JuliaMath / JuliaMath/Decimals.jl

missing floatmin, floatmax, issubnormal

Open
#114 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
62
Forks
24
PR merge metrics
No merged PRs in 30d

Description

One would expect the following to be defined for any floating-point type:
```jl
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
```jl
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:
```jl
julia> (dec"0.1")^1000000000
0E-1000026
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.