Skip to content

Commit

Permalink
hypot scaling constant folding (JuliaLang#36365)
Browse files Browse the repository at this point in the history
The scaling constant in `hypot` wasn't being constant folded. Fixes JuliaLang#36353.
  • Loading branch information
simonbyrne committed Aug 1, 2020
1 parent 40e2d59 commit f2319b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/math.jl
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ function hypot(x::T, y::T) where T<:AbstractFloat
end

# Operands do not vary widely
scale = eps(sqrt(floatmin(T))) #Rescaling constant
scale = eps(T)*sqrt(floatmin(T)) #Rescaling constant
if ax > sqrt(floatmax(T)/2)
ax = ax*scale
ay = ay*scale
Expand Down

0 comments on commit f2319b5

Please sign in to comment.