Skip to content

Commit

Permalink
Issue 332 (#336)
Browse files Browse the repository at this point in the history
* bump SpecialFunctions, version number

* define abs2 differently; address issue #332
  • Loading branch information
jverzani authored Feb 25, 2020
1 parent 115faa5 commit 286ceed
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name = "SymPy"
uuid = "24249f21-da20-56a4-8eb1-6a02cf4ae2e6"
version = "1.0.16"
version = "1.0.17"


[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand Down
2 changes: 1 addition & 1 deletion src/mathfuns.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


Base.abs(x::SymbolicObject) = sympy.Abs(x)
Base.abs2(x::SymbolicObject) = abs(x)^2
Base.abs2(x::SymbolicObject) = x * conj(x)
Base.max(x::Sym, a) = sympy.Max(x, a)
Base.min(x::Sym, a) = sympy.Min(x, a)

Expand Down
7 changes: 7 additions & 0 deletions test/tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,13 @@ end
ex = 3 * sympy.E * x
fn = lambdify(ex)
@test fn(1) 3*exp(1) * 1

## Issue 332 with `abs2`
@vars x real=true
@test abs2(x) == x*x
@vars x
@test abs2(x) == x*conj(x)

end

@testset "generic programming, issue 223" begin
Expand Down

2 comments on commit 286ceed

@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/10072

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 Julia TagBot is installed, or can be done manually through the github interface, or via:

git tag -a v1.0.17 -m "<description of version>" 286ceed8153dcc12c093dd68bb3fed97f05bffa5
git push origin v1.0.17

Please sign in to comment.