loorFloatInteger :: Float -> Integer
floorFloatInteger (F# x) =
    case decodeFloat_Int# x of
      (# m, e #)
        | isTrue# (e <# 0#) ->
          case negateInt# e of
            s | isTrue# (s ># 23#) -> if isTrue# (m <# 0#) then (-1) else 0
              | otherwise          -> smallInteger (m `uncheckedIShiftRA#` s)
        | otherwise -> shiftLInteger (smallInteger m) e

-- ceiling x = -floor (-x)
-- If giving this its own implementation is faster at all,
-- it's only marginally so, hence we keep it short.
{
floorFloatInteger :: Float -> Integer
floorFloatInteger (F# x) =
    case decodeFloat_Int# x of
      (# m, e #)
        | isTrue# (e <# 0#) ->
          case negateInt# e of
            s | isTrue# (s ># 23#) -> if isTrue# (m <# 0#) then (-1) else 0
              | otherwise          -> smallInteger (m `uncheckedIShiftRA#` s)
        | otherwise -> shiftLInteger (smallInteger m) e

-- ceiling x = -floor (-x)
-- If giving this its own implementation is faster at all,
-- it's only marginally so, hence we keep it short.

floorFloatInteger (F# x) =
    case decodeFloat_Int# x of
      (# m, e #)
        | isTrue# (e <# 0#) ->
          case negateInt# e of
            s | isTrue# (s ># 23#) -> if isTrue# (m <# 0#) then (-1) else 0
              | otherwise          -> smallInteger (m `uncheckedIShiftRA#` s)
        | otherwise -> shiftLInteger (smallInteger m) e

-- ceiling x = -floor (-x)
-- If giving this its own implementation is faster at all,
-- it's only marginally so, hence we keep it short.
