Skip to content

Commit e9ef8b9

Browse files
no need for compat
1 parent 05dd872 commit e9ef8b9

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

Project.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ authors = ["Miles Lubin"]
55
version = "1.1.0"
66

77
[deps]
8-
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
98
OpenLibm_jll = "05823500-19ac-5b8b-9628-191a04bc5112"
109

1110
[compat]

src/NaNMath.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
module NaNMath
22

3-
using OpenLibm_jll, Compat
3+
using OpenLibm_jll
44
const libm = OpenLibm_jll.libopenlibm
55

66
for f in (:sin, :cos, :tan, :asin, :acos, :acosh, :atanh, :log, :log2, :log10,
77
:lgamma, :log1p)
88
@eval begin
9-
Compat.@assume_effects :total ($f)(x::Float64) = ccall(($(string(f)),libm), Float64, (Float64,), x)
10-
Compat.@assume_effects :total ($f)(x::Float32) = ccall(($(string(f,"f")),libm), Float32, (Float32,), x)
9+
@assume_effects :total ($f)(x::Float64) = ccall(($(string(f)),libm), Float64, (Float64,), x)
10+
@assume_effects :total ($f)(x::Float32) = ccall(($(string(f,"f")),libm), Float32, (Float32,), x)
1111
($f)(x::Real) = ($f)(float(x))
1212
if $f !== :lgamma
1313
($f)(x) = (Base.$f)(x)
@@ -25,13 +25,13 @@ end
2525

2626
# Would be more efficient to remove the domain check in Base.sqrt(),
2727
# but this doesn't seem easy to do.
28-
Compat.@assume_effects :nothrow sqrt(x::T) where {T<:Union{Float16, Float32, Float64}} = x < 0.0 ? T(NaN) : Base.sqrt(x)
28+
@assume_effects :nothrow sqrt(x::T) where {T<:Union{Float16, Float32, Float64}} = x < 0.0 ? T(NaN) : Base.sqrt(x)
2929
sqrt(x::T) where {T<:AbstractFloat} = x < 0.0 ? T(NaN) : Base.sqrt(x)
3030
sqrt(x::Real) = sqrt(float(x))
3131

3232
# Don't override built-in ^ operator
33-
Compat.@assume_effects :total pow(x::Float64, y::Float64) = ccall((:pow,libm), Float64, (Float64,Float64), x, y)
34-
Compat.@assume_effects :total pow(x::Float32, y::Float32) = ccall((:powf,libm), Float32, (Float32,Float32), x, y)
33+
@assume_effects :total pow(x::Float64, y::Float64) = ccall((:pow,libm), Float64, (Float64,Float64), x, y)
34+
@assume_effects :total pow(x::Float32, y::Float32) = ccall((:powf,libm), Float32, (Float32,Float32), x, y)
3535
# We `promote` first before converting to floating pointing numbers to ensure that
3636
# e.g. `pow(::Float32, ::Int)` ends up calling `pow(::Float32, ::Float32)`
3737
pow(x::Real, y::Real) = pow(promote(x, y)...)

0 commit comments

Comments
 (0)