1
1
for (type, base_type, _) in ABSTRACT_QUANTITY_TYPES
2
+ div_base_type = type == AbstractGenericQuantity ? Number : base_type
2
3
@eval begin
3
4
function Base.:* (l:: $type , r:: $type )
4
5
l, r = promote_except_value (l, r)
@@ -20,7 +21,7 @@ for (type, base_type, _) in ABSTRACT_QUANTITY_TYPES
20
21
function Base.:/ (l:: $type , r:: $base_type )
21
22
new_quantity (typeof (l), ustrip (l) / r, dimension (l))
22
23
end
23
- function Base. div (x:: $type , y:: $base_type , r:: RoundingMode = RoundToZero)
24
+ function Base. div (x:: $type , y:: $div_base_type , r:: RoundingMode = RoundToZero)
24
25
new_quantity (typeof (x), div (ustrip (x), y, r), dimension (x))
25
26
end
26
27
@@ -30,7 +31,7 @@ for (type, base_type, _) in ABSTRACT_QUANTITY_TYPES
30
31
function Base.:/ (l:: $base_type , r:: $type )
31
32
new_quantity (typeof (r), l / ustrip (r), inv (dimension (r)))
32
33
end
33
- function Base. div (x:: $base_type , y:: $type , r:: RoundingMode = RoundToZero)
34
+ function Base. div (x:: $div_base_type , y:: $type , r:: RoundingMode = RoundToZero)
34
35
new_quantity (typeof (y), div (x, ustrip (y), r), inv (dimension (y)))
35
36
end
36
37
0 commit comments