We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a1f3f66 commit 68f4599Copy full SHA for 68f4599
src/tools.jl
@@ -64,7 +64,7 @@ end
64
65
function cmp_exp(lhs, rhs)
66
@switch (lhs, rhs) begin
67
- @case (Neg(a::Token{:float64}), b::Token{:float64})
+ @case (Neg(a::Token{:float64}), b::Token{:float64}) || (b::Token{:float64}, Neg(a::Token{:float64}))
68
startswith(b.str, '-') && a.str == b.str[2:end]
69
@case _
70
cmp_ast(lhs, rhs)
test/runtests.jl
@@ -7,6 +7,7 @@ using Test
7
8
@testset "cmp_exp" begin
9
@test cmp_exp(Neg(qasm_f64(0.2)), qasm_f64(-0.2))
10
+ @test cmp_exp(qasm_f64(-0.2), Neg(qasm_f64(0.2)))
11
end
12
13
@testset "conversion" begin
0 commit comments