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

MathConst was renamed Irrational (JuliaLang/julia#11922) #8

Merged
merged 1 commit into from
Dec 26, 2016
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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ tau == 2*pi
using Tau

tau == τ == 2*pi # => true
typeof(tau) # => MathConst{:τ} (constructor with 1 method)
typeof(tau) # => Irrational{:τ} (constructor with 1 method)
```

The tau variants of `sinpi`, `cospi`, and `mod2pi` are also defined:
Expand Down
2 changes: 1 addition & 1 deletion src/Tau.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export tau, τ,
sinτ, cosτ, modτ

# Use overridden macro definition to define conversion methods for tau
Base.@math_const τ 6.28318530717958647692 (2*big(pi))
Base.@irrational τ 6.28318530717958647692 (2*big(pi))
const tau = τ

include("trig.jl")
Expand Down
3 changes: 1 addition & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ using Base.Test
@test float32(tau) == 2*float32(pi)
@test float64(float32(tau)) == float64(2*float32(pi))
@test big(tau) == 2(big(pi))
@test isa(tau, MathConst)
@test isa(tau, Irrational)

# degree-based trig functions
for T = (Float32,Float64)
Expand Down Expand Up @@ -36,4 +36,3 @@ end
@test_approx_eq modtau(355.0) 3.1416227979431572
@test_approx_eq modtau(355.0f0) 3.1416228f0
@test modtau(int64(2)^60) == modtau(2.0 ^ 60)