{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE MagicHash #-}

-- | Compatibility module for pre ghc-bignum code.
module GHC.Integer.Logarithms
   ( wordLog2#
   , integerLog2#
   , integerLogBase#
   )
where

import qualified GHC.Num.Primitives as N
import qualified GHC.Num.Integer    as N
import GHC.Num.Integer (Integer)
import GHC.Prim

wordLog2# :: Word# -> Int#
wordLog2# :: Word# -> Int#
wordLog2# Word#
i = Word# -> Int#
word2Int# (Word# -> Word#
N.wordLog2# Word#
i)

integerLog2# :: Integer -> Int#
integerLog2# :: Integer -> Int#
integerLog2# Integer
i = Word# -> Int#
word2Int# (Integer -> Word#
N.integerLog2# Integer
i)

integerLogBase# :: Integer -> Integer -> Int#
integerLogBase# :: Integer -> Integer -> Int#
integerLogBase# Integer
x Integer
y = Word# -> Int#
word2Int# (Integer -> Integer -> Word#
N.integerLogBase# Integer
x Integer
y)