Skip to content

Commit

Permalink
Merge pull request #47 from araujoms/master
Browse files Browse the repository at this point in the history
add ^ for integer powers
  • Loading branch information
dzhang314 authored Sep 26, 2024
2 parents ae4bd94 + cc46ce6 commit b1f7cef
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/MultiFloats.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1267,6 +1267,13 @@ end

# TODO: MultiFloat-Int arithmetic operators.

function Base.:(^)(x::_MF{T,N}, p::Integer) where {T,N}
if p >= 0
Base.power_by_squaring(x,p)
else
Base.power_by_squaring(inv(x),-p)
end
end

########################################################### ARITHMETIC OVERLOADS

Expand Down

0 comments on commit b1f7cef

Please sign in to comment.