@@ -64,24 +64,22 @@ for type in (Signed, Float64, Float32, Rational), op in (:flipsign, :copysign)
6464 return $ (op)(x, ustrip (y))
6565 end
6666end
67- function Base.:* (l:: Complex , r:: AbstractRealQuantity )
68- new_quantity (typeof (r), l * ustrip (r), dimension (r))
69- end
70- function Base.:* (l:: AbstractRealQuantity , r:: Complex )
71- new_quantity (typeof (l), ustrip (l) * r, dimension (l))
67+ for type in (Complex, Complex{Bool})
68+ @eval begin
69+ function Base.:* (l:: $type , r:: AbstractRealQuantity )
70+ new_quantity (typeof (r), l * ustrip (r), dimension (r))
71+ end
72+ function Base.:* (l:: AbstractRealQuantity , r:: $type )
73+ new_quantity (typeof (l), ustrip (l) * r, dimension (l))
74+ end
75+ end
7276end
7377function Base.:/ (l:: Complex , r:: AbstractRealQuantity )
7478 new_quantity (typeof (r), l / ustrip (r), inv (dimension (r)))
7579end
7680function Base.:/ (l:: AbstractRealQuantity , r:: Complex )
7781 new_quantity (typeof (l), ustrip (l) / r, dimension (l))
7882end
79- function Base.:* (l:: Complex{Bool} , r:: AbstractRealQuantity )
80- return new_quantity (typeof (r), l * ustrip (r), dimension (r))
81- end
82- function Base.:* (l:: AbstractRealQuantity , r:: Complex{Bool} )
83- return new_quantity (typeof (l), ustrip (l) * r, dimension (l))
84- end
8583for op in (:(== ), :isequal ), base_type in (AbstractIrrational, AbstractFloat)
8684 @eval begin
8785 function Base. $ (op)(l:: AbstractRealQuantity , r:: $base_type )
0 commit comments