Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change from parametric T signature to Int32 in _ldexp_exp #29401

Merged
merged 1 commit into from
Sep 29, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions base/special/hyperbolic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@
# software is freely granted, provided that this notice
# is preserved.
# ====================================================

_ldexp_exp(x::Float64, i::T) where T = ccall(("__ldexp_exp", libm), Float64, (Float64, T), x, i)
_ldexp_exp(x::Float32, i::T) where T = ccall(("__ldexp_expf",libm), Float32, (Float32, T), x, i)
_ldexp_exp(x::Real, i) = _ldexp_exp(float(x, i))
_ldexp_exp(x::Float64, i::Int32) = ccall(("__ldexp_exp", libm), Float64, (Float64, Int32), x, i)
_ldexp_exp(x::Float32, i::Int32) = ccall(("__ldexp_expf",libm), Float32, (Float32, Int32), x, i)
_ldexp_exp(x::Real, i::Int32) = _ldexp_exp(float(x), i)

# Hyperbolic functions
# sinh methods
Expand Down Expand Up @@ -76,7 +75,7 @@ function sinh(x::T) where T <: Union{Float32, Float64}
end
# in d)
if absx < H_OVERFLOW_X(T)
return h*T(2)*_ldexp_exp(absx, -1)
return h*T(2)*_ldexp_exp(absx, Int32(-1))
end
# in e)
return copysign(T(Inf), x)
Expand Down Expand Up @@ -129,7 +128,7 @@ function cosh(x::T) where T <: Union{Float32, Float64}
end
# in e)
if absx < H_OVERFLOW_X(T)
return _ldexp_exp(absx, -1)
return _ldexp_exp(absx, Int32(-1))
end
# in f)
return T(Inf)
Expand Down