Skip to content

Commit b82c939

Browse files
authored
Remove some explicit definitions of div and rem for RoundToZero (#59674)
- one definition of `div` was a duplicate - another definition could be merged with an existing one - the definitions of `rem` were superfluous
1 parent 1eced52 commit b82c939

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

base/div.jl

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ end
322322

323323
# For bootstrapping purposes, we define div for integers directly. Provide the
324324
# generic signature also
325-
div(a::T, b::T, ::typeof(RoundToZero)) where {T<:Union{BitSigned, BitUnsigned64}} = div(a, b)
325+
div(a::T, b::T, ::typeof(RoundToZero)) where {T<:Union{BitSigned, BitUnsigned}} = div(a, b)
326326
div(a::Bool, b::Bool, r::RoundingMode) = div(a, b)
327327
# Prevent ambiguities
328328
for rm in (RoundUp, RoundDown, RoundToZero, RoundFromZero)
@@ -335,10 +335,6 @@ function div(x::Bool, y::Bool, rnd::Union{typeof(RoundNearest),
335335
end
336336
fld(a::T, b::T) where {T<:Union{Integer,AbstractFloat}} = div(a, b, RoundDown)
337337
cld(a::T, b::T) where {T<:Union{Integer,AbstractFloat}} = div(a, b, RoundUp)
338-
div(a::Int128, b::Int128, ::typeof(RoundToZero)) = div(a, b)
339-
div(a::UInt128, b::UInt128, ::typeof(RoundToZero)) = div(a, b)
340-
rem(a::Int128, b::Int128, ::typeof(RoundToZero)) = rem(a, b)
341-
rem(a::UInt128, b::UInt128, ::typeof(RoundToZero)) = rem(a, b)
342338

343339
# These are kept for compatibility with external packages overriding fld / cld.
344340
# In 2.0, packages should extend div(a, b, r) instead, in which case, these can

0 commit comments

Comments
 (0)