Skip to content

Commit acfaca6

Browse files
committed
Base: power_by_squaring: don't require one
* Follows up on/partially reverts JuliaLang#55634 * Reopens JuliaLang#53504, perhaps it's OK to require some types to implement their own `^` for good performance * Fixes JuliaLang#57390, a regression
1 parent 2dd4cdf commit acfaca6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

base/intfuncs.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ end
336336

337337
# ^ for any x supporting *
338338
function to_power_type(x::Number)
339-
T = promote_type(typeof(x), typeof(one(x)), typeof(x*x))
339+
T = promote_type(typeof(x), typeof(x*x))
340340
convert(T, x)
341341
end
342342
to_power_type(x) = oftype(x*x, x)

0 commit comments

Comments
 (0)