File tree 2 files changed +9
-3
lines changed
2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -51,9 +51,7 @@ function _is_one_for_printing(coef)
51
51
return _is_zero_for_printing (abs (coef) - oneunit (coef))
52
52
end
53
53
54
- function _is_one_for_printing (coef:: Complex )
55
- return _is_one_for_printing (real (coef)) && _is_zero_for_printing (imag (coef))
56
- end
54
+ _is_one_for_printing (coef:: Complex{T} ) where {T} = coef == one (T)
57
55
58
56
function _is_zero_for_printing (coef:: Complex )
59
57
return _is_zero_for_printing (real (coef)) &&
Original file line number Diff line number Diff line change @@ -965,6 +965,14 @@ function test_show_latex_parameter()
965
965
return
966
966
end
967
967
968
+ function test_minus_one_complex_aff_expr ()
969
+ model = Model ()
970
+ @variable (model, x)
971
+ f = 1.0im * x + 1.0im
972
+ @test sprint (show, im * f) == " (-1.0 + 0.0im) x + (-1.0 + 0.0im)"
973
+ return
974
+ end
975
+
968
976
end
969
977
970
978
TestPrint. runtests ()
You can’t perform that action at this time.
0 commit comments