Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Compatibility module for pre ghc-bignum code.
Synopsis
- data Integer
- smallInteger :: Int# -> Integer
- wordToInteger :: Word# -> Integer
- integerToWord :: Integer -> Word#
- integerToInt :: Integer -> Int#
- encodeFloatInteger :: Integer -> Int# -> Float#
- floatFromInteger :: Integer -> Float#
- encodeDoubleInteger :: Integer -> Int# -> Double#
- decodeDoubleInteger :: Double# -> (# Integer, Int# #)
- doubleFromInteger :: Integer -> Double#
- plusInteger :: Integer -> Integer -> Integer
- minusInteger :: Integer -> Integer -> Integer
- timesInteger :: Integer -> Integer -> Integer
- negateInteger :: Integer -> Integer
- absInteger :: Integer -> Integer
- signumInteger :: Integer -> Integer
- divModInteger :: Integer -> Integer -> (# Integer, Integer #)
- divInteger :: Integer -> Integer -> Integer
- modInteger :: Integer -> Integer -> Integer
- quotRemInteger :: Integer -> Integer -> (# Integer, Integer #)
- quotInteger :: Integer -> Integer -> Integer
- remInteger :: Integer -> Integer -> Integer
- eqInteger :: Integer -> Integer -> Bool
- neqInteger :: Integer -> Integer -> Bool
- leInteger :: Integer -> Integer -> Bool
- gtInteger :: Integer -> Integer -> Bool
- ltInteger :: Integer -> Integer -> Bool
- geInteger :: Integer -> Integer -> Bool
- compareInteger :: Integer -> Integer -> Ordering
- eqInteger# :: Integer -> Integer -> Int#
- neqInteger# :: Integer -> Integer -> Int#
- leInteger# :: Integer -> Integer -> Int#
- gtInteger# :: Integer -> Integer -> Int#
- ltInteger# :: Integer -> Integer -> Int#
- geInteger# :: Integer -> Integer -> Int#
- andInteger :: Integer -> Integer -> Integer
- orInteger :: Integer -> Integer -> Integer
- xorInteger :: Integer -> Integer -> Integer
- complementInteger :: Integer -> Integer
- shiftLInteger :: Integer -> Int# -> Integer
- shiftRInteger :: Integer -> Int# -> Integer
- testBitInteger :: Integer -> Int# -> Bool
- popCountInteger :: Integer -> Int#
- bitInteger :: Int# -> Integer
- hashInteger :: Integer -> Int#
Documentation
Arbitrary precision integers. In contrast with fixed-size integral types
such as Int
, the Integer
type represents the entire infinite range of
integers.
Integers are stored in a kind of sign-magnitude form, hence do not expect two's complement form when using bit operations.
If the value is small (fit into an Int
), IS
constructor is used.
Otherwise IP
and IN
constructors are used to store a BigNat
representing respectively the positive or the negative value magnitude.
Instances
Construct Integer
s
smallInteger :: Int# -> Integer Source #
wordToInteger :: Word# -> Integer Source #
Conversion to other integral types
integerToWord :: Integer -> Word# Source #
integerToInt :: Integer -> Int# Source #
Helpers for RealFloat
type-class operations
floatFromInteger :: Integer -> Float# Source #
doubleFromInteger :: Integer -> Double# Source #
Arithmetic operations
negateInteger :: Integer -> Integer Source #
absInteger :: Integer -> Integer Source #
signumInteger :: Integer -> Integer Source #
Comparison predicates
Int#
-boolean valued versions of comparison predicates
These operations return 0#
and 1#
instead of False
and
True
respectively. See
PrimBool wiki-page
for more details
Bit-operations
complementInteger :: Integer -> Integer Source #
popCountInteger :: Integer -> Int# Source #
bitInteger :: Int# -> Integer Source #
Hashing
hashInteger :: Integer -> Int# Source #