@@ -297,7 +297,7 @@ for fn in [:trunc, :floor, :ceil]
297
297
val = _apply_exact_float ($ (Symbol (fn, " mul" )), T, x, powt)
298
298
reinterpret (FD{T, f}, val)
299
299
end
300
- # needed to avoid ambiguity
300
+ # needed to avoid ambiguity with e.g. `floor(::Type{T}, x::Rational)`
301
301
@eval function Base. $fn (:: Type{FD{T, f}} , x:: Rational ) where {T, f}
302
302
reinterpret (FD{T, f}, $ fn (T, x * coefficient (FD{T, f})))
303
303
end
@@ -309,15 +309,12 @@ function Base.round(::Type{FD{T, f}}, x::Real, ::RoundingMode{:Nearest}=RoundNea
309
309
reinterpret (FD{T, f}, round (T, x * coefficient (FD{T, f})))
310
310
end
311
311
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)`
316
313
function 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})))
318
315
end
319
316
function 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})))
321
318
end
322
319
323
320
0 commit comments