File tree Expand file tree Collapse file tree 1 file changed +11
-12
lines changed Expand file tree Collapse file tree 1 file changed +11
-12
lines changed Original file line number Diff line number Diff line change 56
56
return z
57
57
end
58
58
59
-
60
59
function mul_by_half (r:: DoubleFloat{T} ) where {T<: IEEEFloat }
61
60
frhi, xphi = frexp (HI (r))
62
61
frlo, xplo = frexp (LO (r))
@@ -120,20 +119,20 @@ function Base.:(^)(r::DoubleFloat{T}, n::Int) where {T<:IEEEFloat}
120
119
return s
121
120
end
122
121
123
- function Base.:(^ )(r:: DoubleFloat{T} , n:: DoubleFloat{T} ) where {T<: IEEEFloat }
124
- if isinteger (n)
125
- return r^ Int (n)
126
- else
127
- return exp (n * log (r))
128
- end
122
+ function Base.:(^ )(r:: DoubleFloat{T} , n:: DoubleFloat{T} ) where {T <: IEEEFloat }
123
+ if isinteger (n)
124
+ return r^ Int64 ( Float64 (n)) # convert n to Float64 first
125
+ else
126
+ return exp (n * log (r))
127
+ end
129
128
end
130
129
131
130
function Base.:(^ )(r:: Int , n:: DoubleFloat{T} ) where {T<: IEEEFloat }
132
- if isinteger (n)
133
- return r^ Int (n)
134
- else
135
- return exp (n * log (r))
136
- end
131
+ if isinteger (n)
132
+ return r^ Int64 ( Float64 (n)) # convert n to Float64 first
133
+ else
134
+ return exp (n * log (r))
135
+ end
137
136
end
138
137
139
138
function calc_exp (a:: DoubleFloat{T} ) where {T<: IEEEFloat }
You can’t perform that action at this time.
0 commit comments