@@ -297,7 +297,7 @@ for fn in [:trunc, :floor, :ceil]
297297 val = _apply_exact_float ($ (Symbol (fn, " mul" )), T, x, powt)
298298 reinterpret (FD{T, f}, val)
299299 end
300- # needed to avoid ambiguity
300+ # needed to avoid ambiguity with e.g. `floor(::Type{T}, x::Rational)`
301301 @eval function Base. $fn (:: Type{FD{T, f}} , x:: Rational ) where {T, f}
302302 reinterpret (FD{T, f}, $ fn (T, x * coefficient (FD{T, f})))
303303 end
@@ -309,15 +309,12 @@ function Base.round(::Type{FD{T, f}}, x::Real, ::RoundingMode{:Nearest}=RoundNea
309309 reinterpret (FD{T, f}, round (T, x * coefficient (FD{T, f})))
310310end
311311
312- # needed to avoid ambiguity
313- function Base. round (:: Type{FD{T, f}} , x:: Rational , :: RoundingMode{:Nearest} = RoundNearest) where {T, f}
314- reinterpret (FD{T, f}, round (T, x * coefficient (FD{T, f})))
315- end
312+ # needed to avoid ambiguity with `round(::Type{T}, x::Rational{Bool}, ::RoundingMode)`
316313function Base. round (:: Type{FD{T, f}} , x:: Rational{Bool} , :: RoundingMode{:Nearest} = RoundNearest) where {T, f}
317- reinterpret (FD{T, f}, round (T, x * coefficient (FD{T, f})))
314+ reinterpret (FD{T, f}, round (T, x * coefficient (FD{T, f})))
318315end
319316function Base. round (:: Type{FD{T, f}} , x:: Rational{Tr} , :: RoundingMode{:Nearest} = RoundNearest) where {T, f, Tr}
320- reinterpret (FD{T, f}, round (T, x * coefficient (FD{T, f})))
317+ reinterpret (FD{T, f}, round (T, x * coefficient (FD{T, f})))
321318end
322319
323320
0 commit comments