From 90bf1dcd11d2f6bdc637fc2132a4ae5977b05774 Mon Sep 17 00:00:00 2001 From: john verzani Date: Wed, 23 Jun 2021 12:40:11 -0400 Subject: [PATCH] Ceiling fix (#432) * fix ceil * version bump --- Project.toml | 2 +- src/mathfuns.jl | 6 +++--- test/tests.jl | 11 +++++++---- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Project.toml b/Project.toml index cc9764e..941dccd 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "SymPy" uuid = "24249f21-da20-56a4-8eb1-6a02cf4ae2e6" -version = "1.0.48" +version = "1.0.49" [deps] diff --git a/src/mathfuns.jl b/src/mathfuns.jl index 2271f75..1703862 100644 --- a/src/mathfuns.jl +++ b/src/mathfuns.jl @@ -8,7 +8,7 @@ Base.min(x::Sym, a) = sympy.Min(x, a) Base.cbrt(x::Sym) = x^(1//3) -Base.ceil(x::Sym) = ceiling(x) +Base.ceil(x::Sym) = sympy.ceiling(x) ## Trig Base.asech(z::Sym) = log(sqrt(1/z-1)*sqrt(1/z+1) + 1/z) @@ -101,7 +101,7 @@ Base.:~(lhs::SymbolicObject, rhs::SymbolicObject) = Eq(lhs, rhs) """ solve -Use `solve` to solve algebraic equations. +Use `solve` to solve algebraic equations. Examples: @@ -172,7 +172,7 @@ julia> eqn = y'(x) - y(x); julia> dsolve(eqn, y(x), ics=(y,0,1)) |> string # technical to avoid parsing issue with doctesting "Eq(y(x), exp(x))" -julia> eqn = y''(x) - y(x) - exp(x); +julia> eqn = y''(x) - y(x) - exp(x); julia> dsolve(eqn, y(x), ics=((y,0,1), (y, 1, 1//2))) |> string "Eq(y(x), (x/2 + (-exp(2) - 2 + E)/(-2 + 2*exp(2)))*exp(x) + (-E + 3*exp(2))*exp(-x)/(-2 + 2*exp(2)))" diff --git a/test/tests.jl b/test/tests.jl index 326282d..7056ceb 100644 --- a/test/tests.jl +++ b/test/tests.jl @@ -501,7 +501,7 @@ end @testset "Syms macro" begin @syms u @test isa(u, Sym) - + ret = @syms a, b, c @test isa(ret, Tuple{Sym, Sym, Sym}) @@ -509,12 +509,12 @@ end @test isa(x, Sym) @test ask(And(𝑄.real(x), 𝑄.positive(x))) @test string(x) == "x₀" - + @test isa(y, Sym) @test isa(z, Sym) @test ask(𝑄.complex(z)) - + @test isa(n, Sym) @test ask(𝑄.integer(n)) @@ -801,5 +801,8 @@ end A = sympy.MatrixSymbol("A", n, n) @test inv(A) == A.I - + # ceil broken + @syms x + @test limit(ceil(x), x=>0, dir="+") != limit(ceil(x), x=>0, dir="-") + @test limit(floor(x), x=>0, dir="+") != limit(floor(x), x=>0, dir="-") end