We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b30a4b9 commit a5fe900Copy full SHA for a5fe900
src/basicfuns.jl
@@ -292,8 +292,8 @@ This will fall back to the naive calculation for argument types different from `
292
"""
293
log1pmx(x::Real) = log1p(x) - x # Naive fallback
294
295
-function log1pmx(x::Union{Float32, Float64})
296
- if !(-0.425 < x < 0.4) # accurate within 2 ULPs when log2(abs(log1p(x))) > 1.5
+function log1pmx(x::T) where T <: Union{Float32, Float64}
+ if !(T(-0.425) < x < T(0.4)) # accurate within 2 ULPs when log2(abs(log1p(x))) > 1.5
297
return log1p(x) - x
298
else
299
return _log1pmx_ker(x)
0 commit comments