Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into s/rewriter-tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
shashi committed Mar 15, 2024
2 parents 2b9dcd7 + 8d8db32 commit 4fc32c1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "SymbolicUtils"
uuid = "d1185830-fcd6-423d-90d6-eec64667417b"
authors = ["Shashi Gowda"]
version = "1.5.0"
version = "1.5.1"

[deps]
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
Expand Down
2 changes: 1 addition & 1 deletion src/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1166,7 +1166,7 @@ end

\(a::Number, b::SN) = b / a

/(a::SN, b::Number) = (b isa Integer ? 1//b : inv(b)) * a
/(a::SN, b::Number) = (isone(abs(b)) ? b : (b isa Integer ? 1//b : inv(b))) * a

//(a::Union{SN, Number}, b::SN) = a / b

Expand Down
2 changes: 2 additions & 0 deletions test/basics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,8 @@ end
@test (2.5x/3x).num == 2.5
@test (2.5x/3x).den == 3
@test (x/3x) == 1//3
@test isequal(x / 1, x)
@test isequal(x / -1, -x)
end

@testset "LiteralReal" begin
Expand Down

0 comments on commit 4fc32c1

Please sign in to comment.