Skip to content

Commit b05cf1d

Browse files
committed
Delete useless div methods
1 parent 466c907 commit b05cf1d

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

src/math.jl

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,6 @@ for (type, base_type, _) in ABSTRACT_QUANTITY_TYPES
5050
new_quantity(typeof(r), inv(ustrip(r)), l / dimension(r))
5151
end
5252
end
53-
# Comparison with exact value type, in case we had to artificially limit it to Number
54-
!(base_type <: Number) && @eval begin
55-
function Base.div(x::$type{T}, y::T, r::RoundingMode=RoundToZero) where {T<:$base_type}
56-
new_quantity(typeof(x), div(ustrip(x), y, r), dimension(x))
57-
end
58-
function Base.div(x::T, y::$type{T}, r::RoundingMode=RoundToZero) where {T<:$base_type}
59-
new_quantity(typeof(y), div(x, ustrip(y), r), inv(dimension(y)))
60-
end
61-
end
6253
end
6354

6455
Base.:*(l::AbstractDimensions, r::AbstractDimensions) = map_dimensions(+, l, r)
@@ -216,7 +207,7 @@ for (type, base_type, _) in ABSTRACT_QUANTITY_TYPES, f in (:copysign, :flipsign,
216207
end
217208
end
218209
end
219-
# Define :rem
210+
# Define :rem (unfortunately we have to create a method for each rounding mode to avoid ambiguity)
220211
for (type, true_base_type, _) in ABSTRACT_QUANTITY_TYPES, rounding_mode in (RoundingMode, RoundingMode{:ToZero}, RoundingMode{:Down}, RoundingMode{:Up}, RoundingMode{:FromZero})
221212

222213
# We don't want to go more generic than `Number` for mod and rem

0 commit comments

Comments
 (0)