-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Integer library based on GMP
gr
grInteger library based on GMP
@package integer-gmp
@version 1.0.1.0

module GHC.Integer.Logarithms

-- | Compute base-2 log of <a>Word#</a>
gr
grThis is internally implemented as count-leading-zeros machine
grinstruction.
wordLog2# :: Word# -> Int#

-- | Calculate the integer base 2 logarithm of an <a>Integer</a>. The
grcalculation is more efficient than for the general case, on platforms
grwith 32- or 64-bit words much more efficient.
gr
grThe argument must be strictly positive, that condition is <i>not</i>
grchecked.
integerLog2# :: Integer -> Int#

-- | Calculate the integer logarithm for an arbitrary base.
gr
grThe base must be greater than <tt>1</tt>, the second argument, the
grnumber whose logarithm is sought, shall be positive, otherwise the
grresult is meaningless.
gr
grThe following property holds
gr
gr<pre>
grbase ^ <a>integerLogBase#</a> base m &lt;= m &lt; base ^(<a>integerLogBase#</a> base m + 1)
gr</pre>
gr
grfor <tt>base &gt; 1</tt> and <tt>m &gt; 0</tt>.
gr
grNote: Internally uses <a>integerLog2#</a> for base 2
integerLogBase# :: Integer -> Integer -> Int#


-- | The <a>Integer</a> type.
gr
grThis module exposes the <i>portable</i> <a>Integer</a> API. See
gr<a>GHC.Integer.GMP.Internals</a> for the <tt>integer-gmp</tt>-specific
grinternal representation of <a>Integer</a> as well as optimized
grGMP-specific operations.
module GHC.Integer

-- | Invariant: <a>Jn#</a> and <a>Jp#</a> are used iff value doesn't fit in
gr<a>S#</a>
gr
grUseful properties resulting from the invariants:
gr
gr<ul>
gr<li><pre>abs (<a>S#</a> _) &lt;= abs (<a>Jp#</a> _)</pre></li>
gr<li><pre>abs (<a>S#</a> _) &lt; abs (<a>Jn#</a> _)</pre></li>
gr</ul>
data Integer

-- | Construct <a>Integer</a> value from list of <a>Int</a>s.
gr
grThis function is used by GHC for constructing <a>Integer</a> literals.
mkInteger :: Bool -> [Int] -> Integer

-- | Should rather be called <tt>intToInteger</tt>
smallInteger :: Int# -> Integer
wordToInteger :: Word# -> Integer
integerToWord :: Integer -> Word#

-- | Truncates <a>Integer</a> to least-significant <a>Int#</a>
integerToInt :: Integer -> Int#
encodeFloatInteger :: Integer -> Int# -> Float#
floatFromInteger :: Integer -> Float#
encodeDoubleInteger :: Integer -> Int# -> Double#
decodeDoubleInteger :: Double# -> (# Integer, Int# #)
doubleFromInteger :: Integer -> Double#

-- | Add two <a>Integer</a>s
plusInteger :: Integer -> Integer -> Integer

-- | Subtract one <a>Integer</a> from another.
minusInteger :: Integer -> Integer -> Integer

-- | Multiply two <a>Integer</a>s
timesInteger :: Integer -> Integer -> Integer

-- | Negate <a>Integer</a>
negateInteger :: Integer -> Integer

-- | Compute absolute value of an <a>Integer</a>
absInteger :: Integer -> Integer

-- | Return <tt>-1</tt>, <tt>0</tt>, and <tt>1</tt> depending on whether
grargument is negative, zero, or positive, respectively
signumInteger :: Integer -> Integer

-- | Simultaneous <a>divInteger</a> and <a>modInteger</a>.
gr
grDivisor must be non-zero otherwise the GHC runtime will terminate with
gra division-by-zero fault.
divModInteger :: Integer -> Integer -> (# Integer, Integer #)
divInteger :: Integer -> Integer -> Integer
modInteger :: Integer -> Integer -> Integer

-- | Simultaneous <a>quotInteger</a> and <a>remInteger</a>.
gr
grDivisor must be non-zero otherwise the GHC runtime will terminate with
gra division-by-zero fault.
quotRemInteger :: Integer -> Integer -> (# Integer, Integer #)
quotInteger :: Integer -> Integer -> Integer
remInteger :: Integer -> Integer -> Integer
eqInteger :: Integer -> Integer -> Bool

-- | Not-equal predicate.
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#

-- | Bitwise AND operation
andInteger :: Integer -> Integer -> Integer

-- | Bitwise OR operation
orInteger :: Integer -> Integer -> Integer

-- | Bitwise XOR operation
xorInteger :: Integer -> Integer -> Integer

-- | Bitwise <tt>NOT</tt> operation
complementInteger :: Integer -> Integer

-- | Shift-left operation
gr
grEven though the shift-amount is expressed as <a>Int#</a>, the result
gris undefined for negative shift-amounts.
shiftLInteger :: Integer -> Int# -> Integer

-- | Arithmetic shift-right operation
gr
grEven though the shift-amount is expressed as <a>Int#</a>, the result
gris undefined for negative shift-amounts.
shiftRInteger :: Integer -> Int# -> Integer

-- | Test if <i>n</i>-th bit is set.
testBitInteger :: Integer -> Int# -> Bool
hashInteger :: Integer -> Int#


-- | This modules provides access to the <a>Integer</a> constructors and
grexposes some highly optimized GMP-operations.
gr
grNote that since <tt>integer-gmp</tt> does not depend on <tt>base</tt>,
grerror reporting via exceptions, <tt>error</tt>, or <tt>undefined</tt>
gris not available. Instead, the low-level functions will crash the
grruntime if called with invalid arguments.
gr
grSee also <a>GHC Commentary: Libraries/Integer</a>.
module GHC.Integer.GMP.Internals

-- | Invariant: <a>Jn#</a> and <a>Jp#</a> are used iff value doesn't fit in
gr<a>S#</a>
gr
grUseful properties resulting from the invariants:
gr
gr<ul>
gr<li><pre>abs (<a>S#</a> _) &lt;= abs (<a>Jp#</a> _)</pre></li>
gr<li><pre>abs (<a>S#</a> _) &lt; abs (<a>Jn#</a> _)</pre></li>
gr</ul>
data Integer

-- | iff value in <tt>[minBound::<a>Int</a>, maxBound::<a>Int</a>]</tt>
grrange
S# :: !Int# -> Integer

-- | iff value in <tt>]maxBound::<a>Int</a>, +inf[</tt> range
Jp# :: {-# UNPACK #-} !BigNat -> Integer

-- | iff value in <tt>]-inf, minBound::<a>Int</a>[</tt> range
Jn# :: {-# UNPACK #-} !BigNat -> Integer

-- | Test whether all internal invariants are satisfied by <a>Integer</a>
grvalue
gr
grReturns <tt>1#</tt> if valid, <tt>0#</tt> otherwise.
gr
grThis operation is mostly useful for test-suites and/or code which
grconstructs <a>Integer</a> values directly.
isValidInteger# :: Integer -> Int#

-- | <a>Integer</a> for which only <i>n</i>-th bit is set. Undefined
grbehaviour for negative <i>n</i> values.
bitInteger :: Int# -> Integer

-- | Count number of set bits. For negative arguments returns negative
grpopulation count of negated argument.
popCountInteger :: Integer -> Int#

-- | Compute greatest common divisor.
gcdInteger :: Integer -> Integer -> Integer

-- | Extended euclidean algorithm.
gr
grFor <tt><i>a</i></tt> and <tt><i>b</i></tt>, compute their greatest
grcommon divisor <tt><i>g</i></tt> and the coefficient <tt><i>s</i></tt>
grsatisfying <tt><i>a</i><i>s</i> + <i>b</i><i>t</i> = <i>g</i></tt>.
gcdExtInteger :: Integer -> Integer -> (# Integer, Integer #)

-- | Compute least common multiple.
lcmInteger :: Integer -> Integer -> Integer

-- | Square <a>Integer</a>
sqrInteger :: Integer -> Integer

-- | "<tt><a>powModInteger</a> <i>b</i> <i>e</i> <i>m</i></tt>" computes
grbase <tt><i>b</i></tt> raised to exponent <tt><i>e</i></tt> modulo
gr<tt>abs(<i>m</i>)</tt>.
gr
grNegative exponents are supported if an inverse modulo
gr<tt><i>m</i></tt> exists.
gr
gr<b>Warning</b>: It's advised to avoid calling this primitive with
grnegative exponents unless it is guaranteed the inverse exists, as
grfailure to do so will likely cause program abortion due to a
grdivide-by-zero fault. See also <a>recipModInteger</a>.
gr
grFuture versions of <tt>integer_gmp</tt> may not support negative
gr<tt><i>e</i></tt> values anymore.
powModInteger :: Integer -> Integer -> Integer -> Integer

-- | "<tt><a>powModSecInteger</a> <i>b</i> <i>e</i> <i>m</i></tt>" computes
grbase <tt><i>b</i></tt> raised to exponent <tt><i>e</i></tt> modulo
gr<tt><i>m</i></tt>. It is required that <tt><i>e</i> &gt;= 0</tt> and
gr<tt><i>m</i></tt> is odd.
gr
grThis is a "secure" variant of <a>powModInteger</a> using the
gr<tt>mpz_powm_sec()</tt> function which is designed to be resilient to
grside channel attacks and is therefore intended for cryptographic
grapplications.
gr
grThis primitive is only available when the underlying GMP library
grsupports it (GMP &gt;= 5). Otherwise, it internally falls back to
gr<tt><a>powModInteger</a></tt>, and a warning will be emitted when
grused.
gr
gr@since TODO
powModSecInteger :: Integer -> Integer -> Integer -> Integer

-- | "<tt><a>recipModInteger</a> <i>x</i> <i>m</i></tt>" computes the
grinverse of <tt><i>x</i></tt> modulo <tt><i>m</i></tt>. If the inverse
grexists, the return value <tt><i>y</i></tt> will satisfy <tt>0 &lt;
gr<i>y</i> &lt; abs(<i>m</i>)</tt>, otherwise the result is <tt>0</tt>.
recipModInteger :: Integer -> Integer -> Integer
wordToNegInteger :: Word# -> Integer
bigNatToInteger :: BigNat -> Integer
bigNatToNegInteger :: BigNat -> Integer

-- | Type representing <i>raw</i> arbitrary-precision Naturals
gr
grThis is common type used by <tt>Natural</tt> and <a>Integer</a>. As
grthis type consists of a single constructor wrapping a
gr<a>ByteArray#</a> it can be unpacked.
gr
grEssential invariants:
gr
gr<ul>
gr<li><a>ByteArray#</a> size is an exact multiple of <a>Word#</a>
grsize</li>
gr<li>limbs are stored in least-significant-limb-first order,</li>
gr<li>the most-significant limb must be non-zero, except for</li>
gr<li><tt>0</tt> which is represented as a 1-limb.</li>
gr</ul>
data BigNat
BN# :: ByteArray# -> BigNat

-- | Type representing a GMP Limb
type GmpLimb = Word
type GmpLimb# = Word#

-- | Count of <a>GmpLimb</a>s, must be positive (unless specified
grotherwise).
type GmpSize = Int
type GmpSize# = Int#

-- | Test whether all internal invariants are satisfied by <a>BigNat</a>
grvalue
gr
grReturns <tt>1#</tt> if valid, <tt>0#</tt> otherwise.
gr
grThis operation is mostly useful for test-suites and/or code which
grconstructs <a>Integer</a> values directly.
isValidBigNat# :: BigNat -> Int#

-- | Return number of limbs contained in <a>BigNat</a>.
sizeofBigNat# :: BigNat -> GmpSize#

-- | CAF representing the value <tt>0 :: BigNat</tt>
zeroBigNat :: BigNat

-- | CAF representing the value <tt>1 :: BigNat</tt>
oneBigNat :: BigNat

-- | Special 0-sized bigNat returned in case of arithmetic underflow
gr
grThis is currently only returned by the following operations:
gr
gr<ul>
gr<li><a>minusBigNat</a></li>
gr<li><a>minusBigNatWord</a></li>
gr</ul>
gr
grOther operations such as <a>quotBigNat</a> may return
gr<a>nullBigNat</a> as well as a dummy/place-holder value instead of
gr<tt>undefined</tt> since we can't throw exceptions. But that behaviour
grshould not be relied upon.
gr
grNB: <tt>isValidBigNat# nullBigNat</tt> is false
nullBigNat :: BigNat

-- | Construct <a>BigNat</a> from existing <a>ByteArray#</a> containing
gr<i>n</i> <a>GmpLimb</a>s in least-significant-first order.
gr
grIf possible <a>ByteArray#</a>, will be used directly (i.e. shared
gr<i>without</i> cloning the <a>ByteArray#</a> into a newly allocated
grone)
gr
grNote: size parameter (times <tt>sizeof(GmpLimb)</tt>) must be less or
grequal to its <a>sizeofByteArray#</a>.
byteArrayToBigNat# :: ByteArray# -> GmpSize# -> BigNat

-- | Construct 1-limb <a>BigNat</a> from <a>Word#</a>
wordToBigNat :: Word# -> BigNat

-- | Construct BigNat from 2 limbs. The first argument is the
grmost-significant limb.
wordToBigNat2 :: Word# -> Word# -> BigNat

-- | Equivalent to <tt><a>word2Int#</a> . <a>bigNatToWord</a></tt>
bigNatToInt :: BigNat -> Int#

-- | Same as <tt><a>indexBigNat#</a> bn 0#</tt>
bigNatToWord :: BigNat -> Word#

-- | Extract <i>n</i>-th (0-based) limb in <a>BigNat</a>. <i>n</i> must be
grless than size as reported by <a>sizeofBigNat#</a>.
indexBigNat# :: BigNat -> GmpSize# -> GmpLimb#
plusBigNat :: BigNat -> BigNat -> BigNat
plusBigNatWord :: BigNat -> GmpLimb# -> BigNat

-- | Returns <a>nullBigNat</a> (see <a>isNullBigNat#</a>) in case of
grunderflow
minusBigNat :: BigNat -> BigNat -> BigNat

-- | Returns <a>nullBigNat</a> (see <a>isNullBigNat#</a>) in case of
grunderflow
minusBigNatWord :: BigNat -> GmpLimb# -> BigNat
timesBigNat :: BigNat -> BigNat -> BigNat
timesBigNatWord :: BigNat -> GmpLimb# -> BigNat

-- | Square <a>BigNat</a>
sqrBigNat :: BigNat -> BigNat

-- | If divisor is zero, <tt>(# <a>nullBigNat</a>, <a>nullBigNat</a>
gr#)</tt> is returned
quotRemBigNat :: BigNat -> BigNat -> (# BigNat, BigNat #)

-- | Note: Result of div/0 undefined
quotRemBigNatWord :: BigNat -> GmpLimb# -> (# BigNat, GmpLimb# #)
quotBigNatWord :: BigNat -> GmpLimb# -> BigNat
quotBigNat :: BigNat -> BigNat -> BigNat
remBigNat :: BigNat -> BigNat -> BigNat

-- | div/0 not checked
remBigNatWord :: BigNat -> GmpLimb# -> Word#
gcdBigNat :: BigNat -> BigNat -> BigNat
gcdBigNatWord :: BigNat -> Word# -> Word#

-- | Version of <a>powModInteger</a> operating on <a>BigNat</a>s
powModBigNat :: BigNat -> BigNat -> BigNat -> BigNat

-- | Version of <a>powModInteger</a> for <a>Word#</a>-sized moduli
powModBigNatWord :: BigNat -> BigNat -> GmpLimb# -> GmpLimb#

-- | Version of <a>recipModInteger</a> operating on <a>BigNat</a>s
recipModBigNat :: BigNat -> BigNat -> BigNat
shiftRBigNat :: BigNat -> Int# -> BigNat
shiftLBigNat :: BigNat -> Int# -> BigNat
testBitBigNat :: BigNat -> Int# -> Bool
clearBitBigNat :: BigNat -> Int# -> BigNat
complementBitBigNat :: BigNat -> Int# -> BigNat
setBitBigNat :: BigNat -> Int# -> BigNat
andBigNat :: BigNat -> BigNat -> BigNat
xorBigNat :: BigNat -> BigNat -> BigNat
popCountBigNat :: BigNat -> Int#
orBigNat :: BigNat -> BigNat -> BigNat

-- | Specialised version of
gr
gr<pre>
grbitBigNat = shiftLBigNat (wordToBigNat 1##)
gr</pre>
gr
gravoiding a few redundant allocations
bitBigNat :: Int# -> BigNat

-- | Test if <a>BigNat</a> value is equal to zero.
isZeroBigNat :: BigNat -> Bool

-- | Test for special 0-sized <a>BigNat</a> representing underflows.
isNullBigNat# :: BigNat -> Int#
compareBigNatWord :: BigNat -> GmpLimb# -> Ordering
compareBigNat :: BigNat -> BigNat -> Ordering
eqBigNatWord :: BigNat -> GmpLimb# -> Bool
eqBigNatWord# :: BigNat -> GmpLimb# -> Int#
eqBigNat :: BigNat -> BigNat -> Bool
eqBigNat# :: BigNat -> BigNat -> Int#
gtBigNatWord# :: BigNat -> GmpLimb# -> Int#

-- | Compute greatest common divisor.
gr
gr<b>Warning</b>: result may become negative if (at least) one argument
gris <tt>minBound</tt>
gcdInt :: Int# -> Int# -> Int#

-- | Compute greatest common divisor.
gcdWord :: Word# -> Word# -> Word#

-- | Version of <a>powModInteger</a> operating on <a>Word#</a>s
powModWord :: GmpLimb# -> GmpLimb# -> GmpLimb# -> GmpLimb#

-- | Version of <a>recipModInteger</a> operating on <a>Word#</a>s
recipModWord :: GmpLimb# -> GmpLimb# -> GmpLimb#

-- | Probalistic Miller-Rabin primality test.
gr
gr"<tt><a>testPrimeInteger</a> <i>n</i> <i>k</i></tt>" determines
grwhether <tt><i>n</i></tt> is prime and returns one of the following
grresults:
gr
gr<ul>
gr<li><tt>2#</tt> is returned if <tt><i>n</i></tt> is definitely
grprime,</li>
gr<li><tt>1#</tt> if <tt><i>n</i></tt> is a <i>probable prime</i>,
gror</li>
gr<li><tt>0#</tt> if <tt><i>n</i></tt> is definitely not a prime.</li>
gr</ul>
gr
grThe <tt><i>k</i></tt> argument controls how many test rounds are
grperformed for determining a <i>probable prime</i>. For more details,
grsee <a>GMP documentation for `mpz_probab_prime_p()`</a>.
testPrimeInteger :: Integer -> Int# -> Int#

-- | Version of <a>testPrimeInteger</a> operating on <a>BigNat</a>s
testPrimeBigNat :: BigNat -> Int# -> Int#

-- | Version of <a>testPrimeInteger</a> operating on <a>Word#</a>s
testPrimeWord# :: GmpLimb# -> Int# -> Int#

-- | Compute next prime greater than <tt><i>n</i></tt> probalistically.
gr
grAccording to the GMP documentation, the underlying function
gr<tt>mpz_nextprime()</tt> "uses a probabilistic algorithm to identify
grprimes. For practical purposes it's adequate, the chance of a
grcomposite passing will be extremely small."
nextPrimeInteger :: Integer -> Integer

-- | Version of <tt>nextPrimeInteger</tt> operating on <a>BigNat</a>s
nextPrimeBigNat :: BigNat -> BigNat

-- | Version of <a>nextPrimeInteger</a> operating on <a>Word#</a>s
nextPrimeWord# :: GmpLimb# -> GmpLimb#

-- | Version of <a>sizeInBaseInteger</a> operating on <a>BigNat</a>
sizeInBaseBigNat :: BigNat -> Int# -> Word#

-- | Compute number of digits (without sign) in given <tt><i>base</i></tt>.
gr
grThis function wraps <tt>mpz_sizeinbase()</tt> which has some
grimplementation pecularities to take into account:
gr
gr<ul>
gr<li>"<tt><a>sizeInBaseInteger</a> 0 <i>base</i> = 1</tt>" (see also
grcomment in <a>exportIntegerToMutableByteArray</a>).</li>
gr<li>This function is only defined if <tt><i>base</i> &gt;= 2#</tt> and
gr<tt><i>base</i> &lt;= 256#</tt> (Note: the documentation claims that
gronly <tt><i>base</i> &lt;= 62#</tt> is supported, however the actual
grimplementation supports up to base 256).</li>
gr<li>If <tt><i>base</i></tt> is a power of 2, the result will be exact.
grIn other cases (e.g. for <tt><i>base</i> = 10#</tt>), the result
gr<i>may</i> be 1 digit too large sometimes.</li>
gr<li>"<tt><a>sizeInBaseInteger</a> <i>i</i> 2#</tt>" can be used to
grdetermine the most significant bit of <tt><i>i</i></tt>.</li>
gr</ul>
sizeInBaseInteger :: Integer -> Int# -> Word#

-- | Version of <a>sizeInBaseInteger</a> operating on <a>Word#</a>
sizeInBaseWord# :: Word# -> Int# -> Word#

-- | Version of <a>exportIntegerToAddr</a> operating on <a>BigNat</a>s.
exportBigNatToAddr :: BigNat -> Addr# -> Int# -> IO Word

-- | Dump <a>Integer</a> (without sign) to <tt><i>addr</i></tt> in base-256
grrepresentation.
gr
gr<pre>
gr<a>exportIntegerToAddr</a> <i>i</i> <i>addr</i> <i>e</i>
gr</pre>
gr
grSee description of <a>exportIntegerToMutableByteArray</a> for more
grdetails.
exportIntegerToAddr :: Integer -> Addr# -> Int# -> IO Word

-- | Version of <a>exportIntegerToAddr</a> operating on <a>Word</a>s.
exportWordToAddr :: Word -> Addr# -> Int# -> IO Word

-- | Version of <a>exportIntegerToMutableByteArray</a> operating on
gr<a>BigNat</a>s.
exportBigNatToMutableByteArray :: BigNat -> MutableByteArray# RealWorld -> Word# -> Int# -> IO Word

-- | Dump <a>Integer</a> (without sign) to mutable byte-array in base-256
grrepresentation.
gr
grThe call
gr
gr<pre>
gr<a>exportIntegerToMutableByteArray</a> <i>i</i> <i>mba</i> <i>offset</i> <i>msbf</i>
gr</pre>
gr
grwrites
gr
gr<ul>
gr<li>the <a>Integer</a> <tt><i>i</i></tt></li>
gr<li>into the <a>MutableByteArray#</a> <tt><i>mba</i></tt> starting at
gr<tt><i>offset</i></tt></li>
gr<li>with most significant byte first if <tt>msbf</tt> is <tt>1#</tt>
gror least significant byte first if <tt>msbf</tt> is <tt>0#</tt>,
grand</li>
gr<li>returns number of bytes written.</li>
gr</ul>
gr
grUse "<tt><a>sizeInBaseInteger</a> <i>i</i> 256#</tt>" to compute the
grexact number of bytes written in advance for <tt><i>i</i> /= 0</tt>.
grIn case of <tt><i>i</i> == 0</tt>,
gr<a>exportIntegerToMutableByteArray</a> will write and report zero
grbytes written, whereas <a>sizeInBaseInteger</a> report one byte.
gr
grIt's recommended to avoid calling
gr<a>exportIntegerToMutableByteArray</a> for small integers as this
grfunction would currently convert those to big integers in msbf to call
gr<tt>mpz_export()</tt>.
exportIntegerToMutableByteArray :: Integer -> MutableByteArray# RealWorld -> Word# -> Int# -> IO Word

-- | Version of <a>exportIntegerToMutableByteArray</a> operating on
gr<a>Word</a>s.
exportWordToMutableByteArray :: Word -> MutableByteArray# RealWorld -> Word# -> Int# -> IO Word

-- | Version of <a>importIntegerFromAddr</a> constructing a <a>BigNat</a>
importBigNatFromAddr :: Addr# -> Word# -> Int# -> IO BigNat

-- | Read <a>Integer</a> (without sign) from memory location at
gr<tt><i>addr</i></tt> in base-256 representation.
gr
gr<pre>
gr<a>importIntegerFromAddr</a> <i>addr</i> <i>size</i> <i>msbf</i>
gr</pre>
gr
grSee description of <a>importIntegerFromByteArray</a> for more details.
importIntegerFromAddr :: Addr# -> Word# -> Int# -> IO Integer

-- | Version of <a>importIntegerFromByteArray</a> constructing a
gr<a>BigNat</a>
importBigNatFromByteArray :: ByteArray# -> Word# -> Word# -> Int# -> BigNat

-- | Read <a>Integer</a> (without sign) from byte-array in base-256
grrepresentation.
gr
grThe call
gr
gr<pre>
gr<a>importIntegerFromByteArray</a> <i>ba</i> <i>offset</i> <i>size</i> <i>msbf</i>
gr</pre>
gr
grreads
gr
gr<ul>
gr<li><tt><i>size</i></tt> bytes from the <a>ByteArray#</a>
gr<tt><i>ba</i></tt> starting at <tt><i>offset</i></tt></li>
gr<li>with most significant byte first if <tt><i>msbf</i></tt> is
gr<tt>1#</tt> or least significant byte first if <tt><i>msbf</i></tt> is
gr<tt>0#</tt>, and</li>
gr<li>returns a new <a>Integer</a></li>
gr</ul>
importIntegerFromByteArray :: ByteArray# -> Word# -> Word# -> Int# -> Integer
