@@ -430,7 +430,7 @@ function Base.Checked.mul_with_overflow(x::FD{T,f}, y::FD{T,f}) where {T<:Intege
430
430
powt = coefficient (FD{T, f})
431
431
quotient, remainder = fldmodinline (_widemul (x. i, y. i), powt)
432
432
v = _round_to_nearest (quotient, remainder, powt)
433
- return (reinterpret (FD{T,f}, Base . trunc_int (T, v )), v < typemin (T) || v > typemax (T))
433
+ return (reinterpret (FD{T,f}, rem (v, T )), v < typemin (T) || v > typemax (T))
434
434
end
435
435
436
436
# This does not exist in Base so is just part of this package.
@@ -444,7 +444,7 @@ overflow/underflow did in fact happen. Throws a DivideError on divide-by-zero.
444
444
"""
445
445
function div_with_overflow (x:: FD{T,f} , y:: FD{T,f} ) where {T<: Integer ,f}
446
446
C = coefficient (FD{T, f})
447
- # This case will break the fld call below.
447
+ # This case will break the div call below.
448
448
if y. i == - 1 && T <: Signed && hasmethod (typemin, (Type{T},)) && x. i == typemin (T)
449
449
# To perform the div and overflow means reaching the max and adding 1, so typemin.
450
450
return (x, true )
0 commit comments