Skip to content

Commit

Permalink
Ceiling fix (#432)
Browse files Browse the repository at this point in the history
* fix ceil

* version bump
  • Loading branch information
jverzani authored Jun 23, 2021
1 parent 6bee495 commit 90bf1dc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "SymPy"
uuid = "24249f21-da20-56a4-8eb1-6a02cf4ae2e6"
version = "1.0.48"
version = "1.0.49"


[deps]
Expand Down
6 changes: 3 additions & 3 deletions src/mathfuns.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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)))"
Expand Down
11 changes: 7 additions & 4 deletions test/tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -501,20 +501,20 @@ end
@testset "Syms macro" begin
@syms u
@test isa(u, Sym)

ret = @syms a, b, c
@test isa(ret, Tuple{Sym, Sym, Sym})

@syms x::(real,positive)=>"x₀", y, z::complex, n::integer
@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))

Expand Down Expand Up @@ -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

2 comments on commit 90bf1dc

@jverzani
Copy link
Collaborator Author

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/39496

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 v1.0.49 -m "<description of version>" 90bf1dcd11d2f6bdc637fc2132a4ae5977b05774
git push origin v1.0.49

Please sign in to comment.