JuliaMath / JuliaMath/Decimals.jl
non-integer powers don't work
Open
- Dominant language
- Julia
- Stars
- 62
- Forks
- 24
- PR merge metrics
- No merged PRs in 30d
Description
```jl
julia> (dec"1.2345")^0.5
ERROR: ^ not defined for Decimal
Stacktrace:
[1] error(::String, ::String, ::Type)
@ Base ./error.jl:54
[2] no_op_err(name::String, T::Type)
@ Base ./promotion.jl:622
[3] ^(x::Decimal, y::Decimal)
@ Base ./promotion.jl:627
[4] ^(x::Decimal, y::Float64)
@ Base ./promotion.jl:482
[5] top-level scope
@ REPL[45]:1
```
Maybe define:
```jl
Base.:^(x::Decimal, p::Decimal) = exp(p * log(x))
```
(See also #117.)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.