Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ function Div{T}(n, d, simplified=false; metadata=nothing, kwargs...) where {T}
end

d isa Number && _isone(-d) && return -1 * n
n isa Rat && d isa Rat && return n // d # maybe called by oblivious code in simplify
!(n isa AbstractFloat) && d isa Rat && return n * (1 // d) # maybe called by oblivious code in simplify

# GCD coefficient upon construction
rat, nc = ratcoeff(n)
Expand Down
2 changes: 2 additions & 0 deletions test/basics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,8 @@ end
@test (2x/3y).num.coeff == 2
@test (2x/3y).den.coeff == 3
@test (2x/-3x) == -2//3
@test isequal((2x*y/-3x), -2y/3)
@test isequal((x*y/2x), y/2)
@test (2.5x/3x).num == 2.5
@test (2.5x/3x).den == 3
@test (x/3x) == 1//3
Expand Down
Loading