From aa04d94a39cd7765231ae57d93695045e80ca837 Mon Sep 17 00:00:00 2001 From: Carlo Baldassi Date: Thu, 14 Jun 2018 17:12:25 +0200 Subject: [PATCH] atan2 -> atan --- README.md | 3 +++ src/Compat.jl | 5 +++++ test/runtests.jl | 6 ++++++ 3 files changed, 14 insertions(+) diff --git a/README.md b/README.md index 52dc9b1a1..5e498609c 100644 --- a/README.md +++ b/README.md @@ -416,6 +416,8 @@ Currently, the `@compat` macro supports the following syntaxes: * `Unicode.isnumeric` is now available as `isnumeric` ([#25479]). +* `atan2` is now a 2-argument method of `atan` ([#27253]). + ## New macros * `@__DIR__` has been added ([#18380]) @@ -645,3 +647,4 @@ includes this fix. Find the minimum version from there. [#27077]: https://github.com/JuliaLang/julia/issues/27077 [#27258]: https://github.com/JuliaLang/julia/issues/27258 [#27298]: https://github.com/JuliaLang/julia/issues/27298 +[#27253]: https://github.com/JuliaLang/julia/issues/27253 diff --git a/src/Compat.jl b/src/Compat.jl index b138dea27..915ff6ef4 100644 --- a/src/Compat.jl +++ b/src/Compat.jl @@ -1933,6 +1933,11 @@ if VERSION < v"0.7.0-DEV.5278" export something end +# https://github.com/JuliaLang/julia/pull/27253 +@static if VERSION < v"0.7.0-alpha.44" + Base.atan(x::Real, y::Real) = atan2(x, y) +end + include("deprecated.jl") end # module Compat diff --git a/test/runtests.jl b/test/runtests.jl index c339a7878..73963fa47 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1778,4 +1778,10 @@ let sep = Compat.Sys.iswindows() ? ';' : ':' end end +# 0.7.0-alpha.44 +@test atan(1, 2) == atan(0.5) +@test atan(1.0, 2.0) == atan(0.5) +@test atan(-1.0, -2.0) ≈ atan(0.5) - π +@test atan(big"-1.0", big"-2.0") ≈ atan(big"0.5") - π + nothing