K @      !"#$%&'()*+,-./0123456789:;<=>?None ;@This is represents a mpz_t value in a heap-saving way.The first tuple element, s#, encodes the sign of the integer i (i.e. signum s == signum i), and the number of limbs& used to represent the magnitude. If abs s > 1, the A contains abs s+ limbs encoding the integer. Otherwise, if abs s < 2#, the single limb is stored in the B element instead (and the AP element is undefined and MUST NOT be accessed as it doesn't point to a proper A" but rather to an unsafe-coerced C& in order be polite to the GC -- see DUMMY_BYTE_ARR in gmp-wrappers.cmm)VMore specifically, the following encoding is used (where `"` means undefined/unused):(# 0#, ", 0## #) -> value = 0(# 1#, ", w #) -> value = w(# -1#, ", w #) -> value = -w#(# s#, d, 0## #) -> value = J# s dZThis representation allows to avoid temporary heap allocations (-> Trac #8647) of 1-limb As which fit into the S#6-constructor. Moreover, this allows to delays 1-limb A" heap allocations, as such 1-limb mpz_tFs can be optimistically allocated on the Cmm stack and returned as a #word in case the mpz_t2 wasn't grown beyond 1 limb by the GMP operation. See also the 1 function which ought to be used for converting @s to Integer s and the MP_INT_1LIMB_RETURN() macro in gmp-wrappers.cmm which constructs @7 values in the first place for implementation details.D!Note: This primitive doesn't use @) because its purpose is to instantiate a J#-value.E!Note: This primitive doesn't use @) because its purpose is to instantiate a J#-value.FConvert to arbitrary-precision integer. First {tt Int#} in result is the exponent; second {tt Int#} and {tt ByteArray#} represent an {tt Integer#} holding the mantissa.GHGreatest common divisor, where second argument is an ordinary {tt Int#}.H!Extended greatest common divisor.IGreatest common divisor.J1Divisor is guaranteed to be a factor of dividend.KCompute div and mod simultaneously, where div rounds towards negative infinity andtexttt{(q,r) = divModInteger#(x,y)} implies texttt{plusInteger# (timesInteger# q y) r = x}.L Variant of MM[Satisfies texttt{plusInteger# (timesInteger# (quotInteger# x y) y) (remInteger# x y) == x}.NRounds towards zero.ORounds towards zero.P Variant of QQTCompute div and mod simultaneously, where div rounds towards negative infinity and (q,r) = divModInteger#(x,y) implies &plusInteger# (timesInteger# q y) r = x.ROptimized version of S) for multiplying big-ints with small-intsTOptimized version of U* for substracting small-ints from big-intsVOptimized version of W% for summing big-ints with small-intsXReturns -1,0,1 according as first argument is less than, equal to, or greater than second argument, which is an ordinary Int#.YcReturns -1,0,1 according as first argument is less than, equal to, or greater than second argument.2@Z[\]^_`abcdefghijkDEFlGHImJnopqrKLMNOPQRSTUVWXYst2@Z[\]^_`abcdefghijkDEFlGHImJnopqrKLMNOPQRSTUVWXYst2@Z[\]^_`abcdefghijkDEFlGHImJnopqrKLMNOPQRSTUVWXYstNone ;! Construct % value from list of Cs..This function is used by GHC for constructing % literals.Since: 0.5.1.0 Since: 0.5.1.0 Since: 0.5.1.0 Since: 0.5.1.0Since: 0.5.1.0Since: 0.5.1.0 Compute greatest common divisor.Compute least common multiple.%Arbitrary-precision integers.&!"small" integers fitting into an u'$"big" integers represented as GMP's mpz_t structure.The u field corresponds to mpz_t's _mp_size2 field, which encodes the sign and the number of limbs stored in the A field (i.e. mpz_t's _mp_d field). Note: The AM may have been over-allocated, and thus larger than the size denoted by the u field.sThis representation tries to avoid using the GMP number representation for small integers that fit into a native ui. This allows to reduce (or at least defer) calling into GMP for operations whose results remain in the u-domain.Note: It does notW constitute a violation of invariants to represent an integer which would fit into an u with the '&-constructor. For instance, the value 0/ has (only) two valid representations, either & 0# or ' 0 _.vPromote & to 'wDemote ' to & if possible. See also x.xSmart '& constructor which tries to construct & if possibley Construct % out of a @# as returned by GMP wrapper primopsIMPORTANT: The AT element MUST NOT be accessed unless the size-element indicates more than one limb! See notes at definition site of @ in GHC.Integer.GMP.Prim for more details.z Variant of y for pairs of %s{ Negate MPZ#(Extended euclidean algorithm.For a and b(, compute their greatest common divisor g and the coefficient s satisfying as + bt = g.Since: 0.5.1.0) Compute greatest common divisor.0Since: 0.5.1.01"1 b e" computes base b raised to exponent e.Since: 0.5.1.02"2 b e m" computes base b raised to exponent e modulo m.6Negative exponents are supported if an inverse modulo m exists. It's advised to avoid calling this primitive with negative exponents unless it is guaranteed the inverse exists, as failure to do so will likely cause program abortion due to a divide-by-zero fault. See also 4.Since: 0.5.1.03"3 b e m" computes base b raised to exponent e modulo m. It is required that e > 0 and m is odd.This is a "secure" variant of 2 using the mpz_powm_sec() function which is designed to be resilient to side channel attacks and is therefore intended for cryptographic applications.This primitive is only available when the underlying GMP library supports it (GMP >= 5). Otherwise, it internally falls back to 2*, and a warning will be emitted when used.Since: 0.5.1.04"4 x m" computes the inverse of x modulo m+. If the inverse exists, the return value y will satisfy 0 < y < abs(m), otherwise the result is 0.@Note: The implementation exploits the undocumented property of  mpz_invert()g to not mangle the result operand (which is initialized to 0) in case of non-existence of the inverse.Since: 0.5.1.05(Probalistic Miller-Rabin primality test."5 n k" determines whether n4 is prime and returns one of the following results:2# is returned if n is definitely prime,1# if n is a probable prime, or0# if n is definitely not a prime.The kI argument controls how many test rounds are performed for determining a probable prime. For more details, see  ahttp://gmplib.org/manual/Number-Theoretic-Functions.html#index-mpz_005fprobab_005fprime_005fp-360,GMP documentation for `mpz_probab_prime_p()`.Since: 0.5.1.06 Compute next prime greater than n probalistically.=According to the GMP documentation, the underlying function mpz_nextprime() "uses a probabilistic algorithm to identify primes. For practical purposes it's adequate, the chance of a composite passing will be extremely small."Since: 0.5.1.071Compute number of digits (without sign) in given base."It's recommended to avoid calling 7f for small integers as this function would currently convert those to big integers in order to call mpz_sizeinbase().This function wraps mpz_sizeinbase()B which has some implementation pecularities to take into account:"7 0 base = 1" (see also comment in 8).!This function is only defined if base >= 2# and base <= 256#. (Note: the documentation claims that only base <= 62#M is supported, however the actual implementation supports up to base 256).If baseH is a power of 2, the result will be exact. In other cases (e.g. for base = 10#), the result may# be 1 digit too large sometimes."7 i 2#:" can be used to determine the most significant bit of i.Since: 0.5.1.08Dump %A (without sign) to mutable byte-array in base-256 representation.The call 8 i mba offset orderwritesthe % i into the | mba starting at offset$with most significant byte first if order is 1#' or least significant byte first if order is -1#, and returns number of bytes written.Use "7 i 256#?" to compute the exact number of bytes written in advance for i /= 0 . In case of i == 0, 84 will write and report zero bytes written, whereas 7 report one byte."It's recommended to avoid calling 8f for small integers as this function would currently convert those to big integers in order to call  mpz_export().Since: 0.5.1.09Dump % (without sign) to addr in base-256 representation. 9 addr o eSee description of 8 for more details.Since: 0.5.1.0:Read %; (without sign) from byte-array in base-256 representation.The call : ba offset size orderreadssize bytes from the A ba starting at offset$with most significant byte first if order is 1#' or least significant byte first if order is -1#, andreturns a new %Since: 0.5.1.0;Read %( (without sign) from memory location at addr in base-256 representation. ; addr size orderSee description of : for more details.Since: 0.5.1.0<< returns the same value as  fromIntegralI, although in unboxed form. It might be a reasonable hash function for %$, given a suitable distribution of % values.Note: < is currently just an alias for .Lsign of integer (} if non-negative)Babsolute value expressed in 31 bit chunks, least significant first  !"#$%&'~vwxyz{()*+,-./0123456789:;<J  !"#$%&'~vwxyz{()*+,-./0123456789:;<J  !"#$%&'~vwxyz{()*+,-./0123456789:;<'(c) The University of Glasgow 1994-2008!see libraries/integer-gmp/LICENSEcvs-ghc@haskell.orginternalnon-portable (GHC Extensions)None;,  !"#$%*+,-./0<,%#$ *+,-./  !"0<None%&'()123456789:;%&')(6512347:;89None;None;=Calculate the integer logarithm for an arbitrary base. The base must be greater than 1, the second argument, the number whose logarithm is sought, should be positive, otherwise the result is meaningless. Hbase ^ integerLogBase# base m <= m < base ^ (integerLogBase# base m + 1)for base > 1 and m > 0.>-Calculate the integer base 2 logarithm of an %. The calculation is more efficient than for the general case, on platforms with 32- or 64-bit words much more efficient.:The argument must be strictly positive, that condition is not checked.?;This function calculates the integer base 2 logarithm of a B.=>?=>?=>?=>?      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKIJLIMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~IJIJIMFG integer-gmp GHC.IntegerGHC.Integer.GMP.InternalsGHC.Integer.LogarithmsGHC.Integer.GMP.PrimGHC.Integer.Type mpzToInteger GHC.Integer.Logarithms.Internals mkInteger smallInteger integerToWord integerToInt plusInteger timesInteger minusInteger negateInteger eqInteger# neqInteger# absInteger signumInteger leInteger# gtInteger# ltInteger# geInteger#compareInteger quotInteger remInteger divInteger modInteger divModIntegerquotRemIntegerfloatFromIntegerdoubleFromIntegerencodeFloatIntegerencodeDoubleInteger gcdInteger lcmInteger andInteger orInteger xorIntegercomplementInteger shiftLInteger shiftRInteger wordToIntegerdecodeDoubleIntegerIntegerS#J# gcdExtIntegergcdInt eqInteger neqInteger leInteger gtInteger ltInteger geIntegertestBitInteger powInteger powModIntegerpowModSecIntegerrecipModIntegertestPrimeIntegernextPrimeIntegersizeInBaseIntegerexportIntegerToMutableByteArrayexportIntegerToAddrimportIntegerFromByteArrayimportIntegerFromAddr hashIntegerintegerLogBase# integerLog2# wordLog2#MPZ#ghc-primGHC.Prim ByteArray#Word# GHC.TypesInt word2Integer# int2Integer# decodeDouble#gcdIntegerInt#gcdExtInteger# gcdInteger#divExactInteger#divModInteger#remIntegerWord# remInteger#quotIntegerWord# quotInteger#quotRemIntegerWord#quotRemInteger#timesIntegerInt# timesInteger#minusIntegerInt# minusInteger#plusIntegerInt# plusInteger#cmpIntegerInt# cmpInteger#complementInteger#exportIntegerToAddr# exportIntegerToMutableByteArray#importIntegerFromAddr#importIntegerFromByteArray#sizeInBaseInteger#testPrimeInteger#nextPrimeInteger#recipModInteger#powModSecInteger#powModInteger# powInteger#fdivQ2ExpInteger#mul2ExpInteger#testBitInteger# xorInteger# orInteger# andInteger#gcdInt#divExactIntegerWord#modIntegerWord# modInteger#divIntegerWord# divInteger#divModIntegerWord# integer2Int# integer2Word#Int#toBigtoSmallsmartJ# mpzToInteger2mpzNegMutableByteArray#Trueint_encodeDouble# encodeDouble#int_encodeFloat# encodeFloat# minIntAsBigabsIntdivExact $fOrdInteger $fEqIntegerBAintegerLog2IsPowerOf2# roundingMode# leadingZeros