Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Integer
- integerLogBase :: Integer -> Integer -> Int
- integerLog2 :: Integer -> Int
- integerLog10 :: Integer -> Int
Integer
Invariant: Jn#
and Jp#
are used iff value doesn't fit in S#
Useful properties resulting from the invariants:
Instances
Enum Integer | Since: base-2.1 |
Eq Integer | |
Integral Integer | Since: base-2.0.1 |
Defined in GHC.Real | |
Data Integer | Since: base-4.0.0.0 |
Defined in Data.Data gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Integer -> c Integer # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Integer # toConstr :: Integer -> Constr # dataTypeOf :: Integer -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Integer) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Integer) # gmapT :: (forall b. Data b => b -> b) -> Integer -> Integer # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Integer -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Integer -> r # gmapQ :: (forall d. Data d => d -> u) -> Integer -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Integer -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Integer -> m Integer # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Integer -> m Integer # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Integer -> m Integer # | |
Num Integer | Since: base-2.1 |
Ord Integer | |
Read Integer | Since: base-2.1 |
Real Integer | Since: base-2.0.1 |
Defined in GHC.Real toRational :: Integer -> Rational # | |
Show Integer | Since: base-2.1 |
Ix Integer | Since: base-2.1 |
Lift Integer | |
Hashable Integer | |
Defined in Data.Hashable.Class | |
ToJSON Integer | |
Defined in Data.Aeson.Types.ToJSON | |
ToJSONKey Integer | |
Defined in Data.Aeson.Types.ToJSON | |
FromJSON Integer | This instance includes a bounds check to prevent maliciously
large inputs to fill up the memory of the target system. You can
newtype |
FromJSONKey Integer | |
PrintfArg Integer | Since: base-2.1 |
Defined in Text.Printf formatArg :: Integer -> FieldFormatter # parseFormat :: Integer -> ModifierParser # | |
Bits Integer | Since: base-2.1 |
Defined in Data.Bits (.&.) :: Integer -> Integer -> Integer # (.|.) :: Integer -> Integer -> Integer # xor :: Integer -> Integer -> Integer # complement :: Integer -> Integer # shift :: Integer -> Int -> Integer # rotate :: Integer -> Int -> Integer # setBit :: Integer -> Int -> Integer # clearBit :: Integer -> Int -> Integer # complementBit :: Integer -> Int -> Integer # testBit :: Integer -> Int -> Bool # bitSizeMaybe :: Integer -> Maybe Int # shiftL :: Integer -> Int -> Integer # unsafeShiftL :: Integer -> Int -> Integer # shiftR :: Integer -> Int -> Integer # unsafeShiftR :: Integer -> Int -> Integer # rotateL :: Integer -> Int -> Integer # | |
NFData Integer | |
Defined in Control.DeepSeq | |
Pretty Integer |
|
Defined in Data.Text.Prettyprint.Doc.Internal | |
Serialise Integer | Since: serialise-0.2.0.0 |
KnownNat n => Reifies (n :: Nat) Integer | |
Defined in Data.Reflection | |
() :=> (Enum Integer) | |
() :=> (Eq Integer) | |
() :=> (Integral Integer) | |
() :=> (Num Integer) | |
() :=> (Ord Integer) | |
() :=> (Real Integer) | |
() :=> (Bits Integer) | |
integerLogBase :: Integer -> Integer -> Int #
Calculate the integer logarithm for an arbitrary base.
The base must be greater than 1, the second argument, the number
whose logarithm is sought, must be positive, otherwise an error is thrown.
If base == 2
, the specialised version is called, which is more
efficient than the general algorithm.
Satisfies:
base ^ integerLogBase base m <= m < base ^ (integerLogBase base m + 1)
for base > 1
and m > 0
.
integerLog2 :: Integer -> Int #
Calculate the integer logarithm of an Integer
to base 2.
The argument must be positive, otherwise an error is thrown.
integerLog10 :: Integer -> Int #
Calculate the integer logarithm of an Integer
to base 10.
The argument must be positive, otherwise an error is thrown.