Skip to content

Commit

Permalink
Add sincospi (#727)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmert authored Oct 27, 2020
1 parent aaa2e41 commit aca5c27
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
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

2 comments on commit aca5c27

@martinholters
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/23716

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v3.23.0 -m "<description of version>" aca5c27451606de08bf95d36ec744e406498936c
git push origin v3.23.0

Please sign in to comment.