Skip to content

Commit

Permalink
Merge pull request #8 from waldyrious/mathconst-rename
Browse files Browse the repository at this point in the history
MathConst was renamed Irrational (JuliaLang/julia#11922)
  • Loading branch information
Aerlinger committed Dec 26, 2016
2 parents 47bd64c + 2d5751b commit c3f2169
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
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)

0 comments on commit c3f2169

Please sign in to comment.