Skip to content

Commit

Permalink
remove old fallbacks for subtype Real (#39564)
Browse files Browse the repository at this point in the history
remove redundant Float16 methods for log2, log10, sqrt, and cbrt, replaced in #39537
  • Loading branch information
oscardssmith authored Feb 8, 2021
1 parent 4c5d62b commit fd43841
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
3 changes: 1 addition & 2 deletions base/math.jl
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,6 @@ for f in (:log2, :log10)
@eval begin
@inline ($f)(x::Float64) = nan_dom_err(ccall(($(string(f)), libm), Float64, (Float64,), x), x)
@inline ($f)(x::Float32) = nan_dom_err(ccall(($(string(f, "f")), libm), Float32, (Float32,), x), x)
@inline ($f)(x::Real) = ($f)(float(x))
end
end

Expand Down Expand Up @@ -565,7 +564,7 @@ julia> sqrt(big(complex(-81)))
0.0 + 9.0im
```
"""
sqrt(x::Real) = sqrt(float(x))
sqrt(x)

"""
hypot(x, y)
Expand Down
1 change: 0 additions & 1 deletion base/special/cbrt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ julia> cbrt(big(-27))
-3.0
```
"""
cbrt(x::Real) = cbrt(float(x))
cbrt(x::AbstractFloat) = x < 0 ? -(-x)^(1//3) : x^(1//3)

"""
Expand Down

0 comments on commit fd43841

Please sign in to comment.