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

Add sincospi(x) #727

Merged
merged 1 commit into from
Oct 27, 2020
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "Compat"
uuid = "34da2185-b29b-5c13-b0c7-acf172513d20"
version = "3.22.0"
version = "3.23.0"

[deps]
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ changes in `julia`.

## Supported features

* `sincospi(x)` for calculating the tuple `(sinpi(x), cospi(x))` ([#35816]) (since Compat 3.23)

* `Dates.canonicalize` can now take a `Period` as an input ([#37391]) (since Compat 3.22)

* Import renaming is available through the `@compat` macro, e.g. `@compat import LinearAlgebra as LA` and
Expand Down Expand Up @@ -227,3 +229,4 @@ Note that you should specify the correct minimum version for `Compat` in the
[#35243]: https://github.com/JuliaLang/julia/pull/35243
[#37396]: https://github.com/JuliaLang/julia/pull/37396
[#37391]: https://github.com/JuliaLang/julia/pull/37391
[#35816]: https://github.com/JuliaLang/julia/pull/35816
6 changes: 6 additions & 0 deletions src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,12 @@ if VERSION < v"1.6.0-DEV.820"
Dates.canonicalize(p::Period) = Dates.canonicalize(CompoundPeriod(p))
end

# https://github.com/JuliaLang/julia/pull/35816
if VERSION < v"1.6.0-DEV.292" # 6cd329c371c1db3d9876bc337e82e274e50420e8
export sincospi
sincospi(x) = (sinpi(x), cospi(x))
end

include("iterators.jl")
include("deprecated.jl")

Expand Down
9 changes: 9 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,15 @@ end
@test Dates.canonicalize(Dates.Minute(24*60*1 + 12*60)) == Dates.canonicalize(Dates.CompoundPeriod([Dates.Day(1),Dates.Hour(12)]))
end

# https://github.com/JuliaLang/julia/pull/35816
@testset "sincospi(x)" begin
@test sincospi(0.13) == (sinpi(0.13), cospi(0.13))
@test sincospi(1//3) == (sinpi(1//3), cospi(1//3))
@test sincospi(5) == (sinpi(5), cospi(5))
@test sincospi(ℯ) == (sinpi(ℯ), cospi(ℯ))
@test sincospi(0.13im) == (sinpi(0.13im), cospi(0.13im))
end

include("iterators.jl")

# Import renaming, https://github.com/JuliaLang/julia/pull/37396,
Expand Down