From 2d5751b224c8c2ea2f79231392dbb554637d8b64 Mon Sep 17 00:00:00 2001 From: Waldir Pimenta Date: Sat, 1 Aug 2015 04:27:35 +0100 Subject: [PATCH] MathConst was renamed Irrational (JuliaLang/julia#11922) --- README.md | 2 +- src/Tau.jl | 2 +- test/runtests.jl | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ae824e7..fa0c86a 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/src/Tau.jl b/src/Tau.jl index 774d77b..11cfa60 100644 --- a/src/Tau.jl +++ b/src/Tau.jl @@ -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") diff --git a/test/runtests.jl b/test/runtests.jl index e96b098..ca6b1bb 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -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) @@ -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) -