Skip to content

Commit

Permalink
delete unnecessary abstract type in Base.Rounding (#53093)
Browse files Browse the repository at this point in the history
  • Loading branch information
nsajko authored Feb 1, 2024
1 parent 88218c6 commit 8b88e3b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions base/rounding.jl
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,14 @@ rounds_away_from_zero(t::Tuple{Any,Bool}) = rounds_away_from_zero(t...)
tie_breaker_is_to_even(t::Tuple{Any,Bool}) = tie_breaker_is_to_even(first(t))
tie_breaker_rounds_away_from_zero(t::Tuple{Any,Bool}) = tie_breaker_rounds_away_from_zero(t...)

abstract type RoundingIncrementHelper end
struct FinalBit <: RoundingIncrementHelper end
struct RoundBit <: RoundingIncrementHelper end
struct StickyBit <: RoundingIncrementHelper end
struct FinalBit end
struct RoundBit end
struct StickyBit end

function correct_rounding_requires_increment(x, rounding_mode, sign_bit::Bool)
r = (rounding_mode, sign_bit)
f = let y = x
(z::RoundingIncrementHelper) -> y(z)::Bool
(z::Union{FinalBit,RoundBit,StickyBit}) -> y(z)::Bool
end
if rounds_to_nearest(r)
if f(RoundBit())
Expand Down

0 comments on commit 8b88e3b

Please sign in to comment.