Skip to content

Commit 768d46b

Browse files
juliohmtimholy
authored andcommitted
Rename atan2 to atan in Julia v0.7 and beyond (#93)
1 parent 95c7639 commit 768d46b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/ColorVectorSpace.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import Base: ==, +, -, *, /, ^, <, ~
88
import Base: abs, abs2, clamp, convert, copy, div, eps, isfinite, isinf,
99
isnan, isless, length, mapreduce, oneunit,
1010
promote_op, promote_rule, zero, trunc, floor, round, ceil, bswap,
11-
mod, rem, atan2, hypot, max, min, real, typemin, typemax
11+
mod, rem, atan, hypot, max, min, real, typemin, typemax
1212
import LinearAlgebra: norm
1313
import StatsBase: histrange, varm
1414
import SpecialFunctions: gamma, lgamma, lfact
@@ -255,7 +255,7 @@ abs2(c::AbstractGray) = gray(c)^2
255255
abs2(c::AbstractGray{T}) where {T<:Normed} = Float32(gray(c))^2
256256
abs2(c::TransparentGray) = gray(c)^2+alpha(c)^2
257257
abs2(c::TransparentGrayNormed) = Float32(gray(c))^2 + Float32(alpha(c))^2
258-
atan2(x::Gray, y::Gray) = atan2(convert(Real, x), convert(Real, y))
258+
atan(x::Gray, y::Gray) = atan(convert(Real, x), convert(Real, y))
259259
hypot(x::Gray, y::Gray) = hypot(convert(Real, x), convert(Real, y))
260260
norm(c::TransparentGray) = sqrt(abs2(c))
261261

test/runtests.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ end
7676
@test !isnan(Gray(Inf))
7777
@test abs(Gray(0.1)) 0.1
7878
@test eps(Gray{N0f8}) == Gray(eps(N0f8)) # #282
79+
@test atan(Gray(0.1), Gray(0.2)) == atan(0.1, 0.2)
7980

8081
acu = Gray{N0f8}[cu]
8182
acf = Gray{Float32}[cf]

0 commit comments

Comments
 (0)