diff --git a/reference/gmp/functions/gmp-abs.xml b/reference/gmp/functions/gmp-abs.xml
index c9c4bedb9b..dd52b8a640 100644
--- a/reference/gmp/functions/gmp-abs.xml
+++ b/reference/gmp/functions/gmp-abs.xml
@@ -1,23 +1,23 @@
-
+
-
-
- gmp_abs
- Absolute value
-
-
- Description
-
- resourcegmp_abs
- resourcea
-
-
- Returns absolute value of a.
-
-
- gmp_abs example
-
+
+
+ gmp_abs
+ Absolute value
+
+
+ Description
+
+ resourcegmp_abs
+ resourcea
+
+
+ Returns absolute value of a.
+
+
+ gmp_abs example
+
]]>
-
-
- The printout of the above program will be:
-
-
+
+
+ The printout of the above program will be:
+
+
-
-
-
-
+
+
+
+
+
-
-
- gmp_add
- Add numbers
-
-
- Description
-
- resourcegmp_add
- resourcea
- resourceb
-
-
- Add two GMP numbers. The result will be a GMP number representing
- the sum of the arguments.
-
-
- gmp_add example
-
+
+
+ gmp_add
+ Add numbers
+
+
+ Description
+
+ resourcegmp_add
+ resourcea
+ resourceb
+
+
+ Add two GMP numbers. The result will be a GMP number representing
+ the sum of the arguments.
+
+
+ gmp_add example
+
]]>
-
-
- The printout of the above program will be:
-
-
+
+
+ The printout of the above program will be:
+
+
-
-
-
-
+
+
+
+
+
-
-
- gmp_and
- Logical AND
-
-
- Description
-
- resourcegmp_and
- resourcea
- resourceb
-
-
- Calculates logical AND of two GMP numbers.
-
-
- gmp_and example
-
+
+
+ gmp_and
+ Logical AND
+
+
+ Description
+
+ resourcegmp_and
+ resourcea
+ resourceb
+
+
+ Calculates logical AND of two GMP numbers.
+
+
+ gmp_and example
+
]]>
-
-
- The printout of the above program will be:
-
-
+
+
+ The printout of the above program will be:
+
+
-
-
-
-
+
+
+
+
+
-
-
- gmp_clrbit
- Clear bit
-
-
- Description
-
- voidgmp_clrbit
- resourcea
- intindex
-
-
- Clears (sets to 0) bit index in
- a. The index starts at 0.
-
-
-
- Unlike most of the other GMP functions, gmp_clrbit
- must be called with a GMP resource that already exists (using
- gmp_init for example). One will not be
- automatically created.
-
-
-
- gmp_clrbit example
-
+
+
+ gmp_clrbit
+ Clear bit
+
+
+ Description
+
+ voidgmp_clrbit
+ resourcea
+ intindex
+
+
+ Clears (sets to 0) bit index in
+ a. The index starts at 0.
+
+
+
+ Unlike most of the other GMP functions, gmp_clrbit
+ must be called with a GMP resource that already exists (using
+ gmp_init for example). One will not be
+ automatically created.
+
+
+
+ gmp_clrbit example
+
]]>
-
-
- The printout of the above program will be:
-
-
+
+
+ The printout of the above program will be:
+
+
-
-
-
- See also gmp_setbit and
- gmp_testbit.
-
-
-
+
+
+
+ See also gmp_setbit and
+ gmp_testbit.
+
+
+
+
-
-
- gmp_cmp
- Compare numbers
-
-
- Description
-
- intgmp_cmp
- resourcea
- resourceb
-
-
- Returns a positive value if a > b, zero if
- a = b and a negative value if a <
- b.
-
-
- gmp_cmp example
-
+
+
+ gmp_cmp
+ Compare numbers
+
+
+ Description
+
+ intgmp_cmp
+ resourcea
+ resourceb
+
+
+ Returns a positive value if a > b, zero if
+ a = b and a negative value if a <
+ b.
+
+
+ gmp_cmp example
+
]]>
-
-
- The printout of the above program will be:
-
-
+
+
+ The printout of the above program will be:
+
+
-
-
-
-
+
+
+
+
+
-
-
- gmp_com
- Calculates one's complement
-
-
- Description
-
- resourcegmp_com
- resourcea
-
-
- Returns the one's complement of a.
-
-
- gmp_com example
-
+
+
+ gmp_com
+ Calculates one's complement
+
+
+ Description
+
+ resourcegmp_com
+ resourcea
+
+
+ Returns the one's complement of a.
+
+
+ gmp_com example
+
]]>
-
-
- The printout of the above program will be:
-
-
+
+
+ The printout of the above program will be:
+
+
-
-
+
+
-
-
+
+
+
-
-
- gmp_div_q
- Divide numbers
-
-
- Description
-
- resourcegmp_div_q
- resourcea
- resourceb
- intround
-
-
- Divides a by b and
- returns the integer result. The result rounding is defined by the
- round, which can have the following
- values:
-
-
-
- GMP_ROUND_ZERO: The result is truncated
- towards 0.
-
-
-
-
- GMP_ROUND_PLUSINF: The result is
- rounded towards +infinity.
-
-
-
-
- GMP_ROUND_MINUSINF: The result is
- rounded towards -infinity.
-
-
-
-
-
- This function can also be called as gmp_div.
-
-
- gmp_div_q example
-
+
+
+ gmp_div_q
+ Divide numbers
+
+
+ Description
+
+ resourcegmp_div_q
+ resourcea
+ resourceb
+ intround
+
+
+ Divides a by b and
+ returns the integer result. The result rounding is defined by the
+ round, which can have the following
+ values:
+
+
+
+ GMP_ROUND_ZERO: The result is truncated
+ towards 0.
+
+
+
+
+ GMP_ROUND_PLUSINF: The result is
+ rounded towards +infinity.
+
+
+
+
+ GMP_ROUND_MINUSINF: The result is
+ rounded towards -infinity.
+
+
+
+
+
+ This function can also be called as gmp_div.
+
+
+ gmp_div_q example
+
]]>
-
-
- The printout of the above program will be:
-
-
+
+
+ The printout of the above program will be:
+
+
-
-
-
- See also gmp_div_r,
- gmp_div_qr
-
-
-
+
+
+
+ See also gmp_div_r,
+ gmp_div_qr
+
+
+
+
-
-
- gmp_div_qr
- Divide numbers and get quotient and remainder
-
-
- Description
-
- arraygmp_div_qr
- resourcen
- resourced
- intround
-
-
- The function divides n by
- d and returns array, with the first
- element being [n/d] (the integer result of the
- division) and the second being (n - [n/d] * d)
- (the remainder of the division).
-
-
- See the gmp_div_q function for description
- of the round argument.
-
-
-
- Division of GMP numbers
-
+
+
+ gmp_div_qr
+ Divide numbers and get quotient and remainder
+
+
+ Description
+
+ arraygmp_div_qr
+ resourcen
+ resourced
+ intround
+
+
+ The function divides n by
+ d and returns array, with the first
+ element being [n/d] (the integer result of the
+ division) and the second being (n - [n/d] * d)
+ (the remainder of the division).
+
+
+ See the gmp_div_q function for description
+ of the round argument.
+
+
+
+ Division of GMP numbers
+
]]>
-
-
-
-
- See also gmp_div_q,
- gmp_div_r.
-
-
-
+
+
+
+
+ See also gmp_div_q,
+ gmp_div_r.
+
+
+
+
-
-
- gmp_div_r
- Remainder of the division of numbers
-
-
- Description
-
- resourcegmp_div_r
- resourcen
- resourced
- intround
-
-
- Calculates remainder of the integer division of
- n by d. The
- remainder has the sign of the n argument,
- if not zero.
-
-
- gmp_div_r example
-
+
+
+ gmp_div_r
+ Remainder of the division of numbers
+
+
+ Description
+
+ resourcegmp_div_r
+ resourcen
+ resourced
+ intround
+
+
+ Calculates remainder of the integer division of
+ n by d. The
+ remainder has the sign of the n argument,
+ if not zero.
+
+
+ gmp_div_r example
+
]]>
-
-
- The printout of the above program will be:
-
-
+
+
+ The printout of the above program will be:
+
+
-
-
-
- See the gmp_div_q function for description
- of the round argument.
-
-
- See also gmp_div_q,
- gmp_div_qr
-
-
-
+
+
+
+ See the gmp_div_q function for description
+ of the round argument.
+
+
+ See also gmp_div_q,
+ gmp_div_qr
+
+
+
+
-
-
- gmp_divexact
- Exact division of numbers
-
-
- Description
-
- resourcegmp_divexact
- resourcen
- resourced
-
-
- Divides n by d,
- using fast "exact division" algorithm. This function produces
- correct results only when it is known in advance that
- d divides n.
-
-
- gmp_divexact example
-
+
+
+ gmp_divexact
+ Exact division of numbers
+
+
+ Description
+
+ resourcegmp_divexact
+ resourcen
+ resourced
+
+
+ Divides n by d,
+ using fast "exact division" algorithm. This function produces
+ correct results only when it is known in advance that
+ d divides n.
+
+
+ gmp_divexact example
+
]]>
-
-
- The printout of the above program will be:
-
-
+
+
+ The printout of the above program will be:
+
+
-
-
-
-
+
+
+
+
+
-
-
- gmp_fact
- Factorial
-
-
- Description
-
- resourcegmp_fact
- inta
-
-
- Calculates factorial (a!) of a.
-
-
- gmp_fact example
-
+
+
+ gmp_fact
+ Factorial
+
+
+ Description
+
+ resourcegmp_fact
+ inta
+
+
+ Calculates factorial (a!) of a.
+
+
+ gmp_fact example
+
]]>
-
-
- The printout of the above program will be:
-
-
+
+
+ The printout of the above program will be:
+
+
-
-
-
-
+
+
+
+
+
-
-
- gmp_gcd
- Calculate GCD
-
-
- Description
-
- resourcegmp_gcd
- resourcea
- resourceb
-
-
- Calculate greatest common divisor of a and
- b. The result is always positive even if
- either of, or both, input operands are negative.
-
-
- gmp_gcd example
-
+
+
+ gmp_gcd
+ Calculate GCD
+
+
+ Description
+
+ resourcegmp_gcd
+ resourcea
+ resourceb
+
+
+ Calculate greatest common divisor of a and
+ b. The result is always positive even if
+ either of, or both, input operands are negative.
+
+
+ gmp_gcd example
+
]]>
-
-
- The printout of the above program will be:
-
-
+
+
+ The printout of the above program will be:
+
+
-
-
-
-
+
+
+
+
+
-
-
- gmp_gcdext
- Calculate GCD and multipliers
-
-
- Description
-
- arraygmp_gcdext
- resourcea
- resourceb
-
-
- Calculates g, s, and t, such that a*s + b*t = g =
- gcd(a,b), where gcd is the greatest common divisor. Returns
- an array with respective elements g, s and t.
-
-
- This function can be used to solve linear Diophantine equations in two
- variables. These are equations that allow only integer solutions and have the form:
- a*x + b*y = c.
- For more information, go to the "Diophantine
- Equation" page at MathWorld
-
-
-
- Solving a linear Diophantine equation
-
+
+
+ gmp_gcdext
+ Calculate GCD and multipliers
+
+
+ Description
+
+ arraygmp_gcdext
+ resourcea
+ resourceb
+
+
+ Calculates g, s, and t, such that a*s + b*t = g =
+ gcd(a,b), where gcd is the greatest common divisor. Returns
+ an array with respective elements g, s and t.
+
+
+ This function can be used to solve linear Diophantine equations in two
+ variables. These are equations that allow only integer solutions and have the form:
+ a*x + b*y = c.
+ For more information, go to the "Diophantine
+ Equation" page at MathWorld
+
+
+
+ Solving a linear Diophantine equation
+
]]>
-
-
-
-
-
+
+
+
+
+
+
-
-
- gmp_hamdist
- Hamming distance
-
-
- Description
-
- intgmp_hamdist
- resourcea
- resourceb
-
-
- Returns the hamming distance between a and
- b. Both operands should be non-negative.
-
-
- gmp_hamdist example
-
+
+
+ gmp_hamdist
+ Hamming distance
+
+
+ Description
+
+ intgmp_hamdist
+ resourcea
+ resourceb
+
+
+ Returns the hamming distance between a and
+ b. Both operands should be non-negative.
+
+
+ gmp_hamdist example
+
]]>
-
-
- The printout of the above program will be:
-
-
+
+
+ The printout of the above program will be:
+
+
-
-
-
- See also gmp_popcount,
- gmp_xor
-
-
-
+
+
+
+ See also gmp_popcount,
+ gmp_xor
+
+
+
+
-
-
- gmp_init
- Create GMP number
-
-
- Description
-
- resourcegmp_init
- mixednumber
- intbase
-
-
- Creates a GMP number from an integer or string. String
- representation can be decimal, hexadecimal or octal.
- Optional parameter base is available since
- PHP 4.1.0. Its default value is 0.
-
-
- The base may vary from 2 to 36. If base is 0 (default value), the
- actual base is determined from the leading characters: if the first
- two characters are 0x or 0X,
- hexadecimal is assumed, otherwise if the first character is "0",
- octal is assumed, otherwise decimal is assumed.
-
-
-
- Creating GMP number
-
+
+
+ gmp_init
+ Create GMP number
+
+
+ Description
+
+ resourcegmp_init
+ mixednumber
+ intbase
+
+
+ Creates a GMP number from an integer or string. String
+ representation can be decimal, hexadecimal or octal.
+ Optional parameter base is available since
+ PHP 4.1.0. Its default value is 0.
+
+
+ The base may vary from 2 to 36. If base is 0 (default value), the
+ actual base is determined from the leading characters: if the first
+ two characters are 0x or 0X,
+ hexadecimal is assumed, otherwise if the first character is "0",
+ octal is assumed, otherwise decimal is assumed.
+
+
+
+ Creating GMP number
+
]]>
-
-
-
+
+
+
-
-
- It is not necessary to call this function if you want to use
- integer or string in place of GMP number in GMP functions, like
- gmp_add. Function arguments are
- automatically converted to GMP numbers, if such conversion is
- possible and needed, using the same rules as
- gmp_init.
-
-
-
-
+
+
+ It is not necessary to call this function if you want to use
+ integer or string in place of GMP number in GMP functions, like
+ gmp_add. Function arguments are
+ automatically converted to GMP numbers, if such conversion is
+ possible and needed, using the same rules as
+ gmp_init.
+
+
+
+
+
-
-
- gmp_intval
- Convert GMP number to integer
-
-
- Description
-
- intgmp_intval
- resourcegmpnumber
-
-
- This function allows to convert GMP number to integer.
-
-
- This function returns a useful result only if the number actually
- fits the PHP integer (i.e., signed long type). If you want just
- to print the GMP number, use gmp_strval.
-
-
-
-
- gmp_intval example
-
+
+
+ gmp_intval
+ Convert GMP number to integer
+
+
+ Description
+
+ intgmp_intval
+ resourcegmpnumber
+
+
+ This function allows to convert GMP number to integer.
+
+
+ This function returns a useful result only if the number actually
+ fits the PHP integer (i.e., signed long type). If you want just
+ to print the GMP number, use gmp_strval.
+
+
+
+
+ gmp_intval example
+
]]>
-
-
- The printout of the above program will be:
-
-
+
+
+ The printout of the above program will be:
+
+
-
-
-
-
+
+
+
+
+
-
-
- gmp_invert
- Inverse by modulo
-
-
- Description
-
- resourcegmp_invert
- resourcea
- resourceb
-
-
- Computes the inverse of a modulo
- b. Returns &false; if an inverse does not
- exist.
-
-
- gmp_invert example
-
+
+
+ gmp_invert
+ Inverse by modulo
+
+
+ Description
+
+ resourcegmp_invert
+ resourcea
+ resourceb
+
+
+ Computes the inverse of a modulo
+ b. Returns &false; if an inverse does not
+ exist.
+
+
+ gmp_invert example
+
]]>
-
-
- The printout of the above program will be:
-
-
+
+
+ The printout of the above program will be:
+
+
-
-
-
-
+
+
+
+
+
-
-
- gmp_jacobi
- Jacobi symbol
-
-
- Description
-
- intgmp_jacobi
- resourcea
- resourcep
-
-
- Computes
-
- Jacobi symbol of a and
- p. p should be odd
- and must be positive.
-
-
- gmp_jacobi example
-
+
+
+ gmp_jacobi
+ Jacobi symbol
+
+
+ Description
+
+ intgmp_jacobi
+ resourcea
+ resourcep
+
+
+ Computes
+
+ Jacobi symbol of a and
+ p. p should be odd
+ and must be positive.
+
+
+ gmp_jacobi example
+
]]>
-
-
- The printout of the above program will be:
-
-
+
+
+ The printout of the above program will be:
+
+
-
-
-
-
+
+
+
+
+
-
-
- gmp_legendre
- Legendre symbol
-
-
- Description
-
- intgmp_legendre
- resourcea
- resourcep
-
-
- Compute the
-
- Legendre symbol of a and
- p. p should be odd
- and must be positive.
-
-
- gmp_legendre example
-
+
+
+ gmp_legendre
+ Legendre symbol
+
+
+ Description
+
+ intgmp_legendre
+ resourcea
+ resourcep
+
+
+ Compute the
+
+ Legendre symbol of a and
+ p. p should be odd
+ and must be positive.
+
+
+ gmp_legendre example
+
]]>
-
-
- The printout of the above program will be:
-
-
+
+
+ The printout of the above program will be:
+
+
-
-
-
-
+
+
+
+
+
-
-
- gmp_mod
- Modulo operation
-
-
- Description
-
- resourcegmp_mod
- resourcen
- resourced
-
-
- Calculates n modulo
- d. The result is always non-negative, the
- sign of d is ignored.
-
-
- gmp_mod example
-
+
+
+ gmp_mod
+ Modulo operation
+
+
+ Description
+
+ resourcegmp_mod
+ resourcen
+ resourced
+
+
+ Calculates n modulo
+ d. The result is always non-negative, the
+ sign of d is ignored.
+
+
+ gmp_mod example
+
]]>
-
-
- The printout of the above program will be:
-
-
+
+
+ The printout of the above program will be:
+
+
-
-
-
-
+
+
+
+
+
-
-
- gmp_mul
- Multiply numbers
-
-
- Description
-
- resourcegmp_mul
- resourcea
- resourceb
-
-
- Multiplies a by b
- and returns the result.
-
-
- gmp_mul example
-
+
+
+ gmp_mul
+ Multiply numbers
+
+
+ Description
+
+ resourcegmp_mul
+ resourcea
+ resourceb
+
+
+ Multiplies a by b
+ and returns the result.
+
+
+ gmp_mul example
+
]]>
-
-
- The printout of the above program will be:
-
-
+
+
+ The printout of the above program will be:
+
+
-
-
-
-
+
+
+
+
+
-
-
- gmp_neg
- Negate number
-
-
- Description
-
- resourcegmp_neg
- resourcea
-
-
- Returns -a.
-
-
- gmp_neg example
-
+
+
+ gmp_neg
+ Negate number
+
+
+ Description
+
+ resourcegmp_neg
+ resourcea
+
+
+ Returns -a.
+
+
+ gmp_neg example
+
]]>
-
-
- The printout of the above program will be:
-
-
+
+
+ The printout of the above program will be:
+
+
-
-
-
-
+
+
+
+
-
-
- gmp_nextprime
- Find next prime number
-
-
- Description
-
- resourcegmp_nextprime
- inta
-
-
- Return next prime number greater than a.
-
-
- This function uses a probabilistic algorithm to identify primes and
- chances to get a composite number are extremely small.
-
-
- gmp_nextprime example
-
+
+
+
+ gmp_nextprime
+ Find next prime number
+
+
+ Description
+
+ resourcegmp_nextprime
+ inta
+
+
+ Return next prime number greater than a.
+
+
+ This function uses a probabilistic algorithm to identify primes and
+ chances to get a composite number are extremely small.
+
+
+ gmp_nextprime example
+
]]>
-
-
- The printout of the above program is:
-
-
+
+
+ The printout of the above program is:
+
+
-
-
-
-
+
+
+
+
+
-
-
- gmp_or
- Logical OR
-
-
- Description
-
- resourcegmp_or
- resourcea
- resourceb
-
-
- Calculates logical inclusive OR of two GMP numbers.
-
-
- gmp_or example
-
+
+
+ gmp_or
+ Logical OR
+
+
+ Description
+
+ resourcegmp_or
+ resourcea
+ resourceb
+
+
+ Calculates logical inclusive OR of two GMP numbers.
+
+
+ gmp_or example
+
]]>
-
-
- The printout of the above program will be:
-
-
+
+
+ The printout of the above program will be:
+
+
-
-
-
-
+
+
+
+
+
-
-
- gmp_perfect_square
- Perfect square check
-
-
- Description
-
- boolgmp_perfect_square
- resourcea
-
-
- Returns &true; if a is a perfect square,
- &false; otherwise.
-
-
- gmp_perfect_square example
-
+
+
+ gmp_perfect_square
+ Perfect square check
+
+
+ Description
+
+ boolgmp_perfect_square
+ resourcea
+
+
+ Returns &true; if a is a perfect square,
+ &false; otherwise.
+
+
+ gmp_perfect_square example
+
]]>
-
-
- The printout of the above program will be:
-
-
+
+
+ The printout of the above program will be:
+
+
-
-
-
- See also: gmp_sqrt,
- gmp_sqrtrem.
-
-
-
+
+
+
+ See also: gmp_sqrt,
+ gmp_sqrtrem.
+
+
+
+
-
-
- gmp_popcount
- Population count
-
-
- Description
-
- intgmp_popcount
- resourcea
-
-
- Return the population count of a.
-
-
- gmp_popcount example
-
+
+
+ gmp_popcount
+ Population count
+
+
+ Description
+
+ intgmp_popcount
+ resourcea
+
+
+ Return the population count of a.
+
+
+ gmp_popcount example
+
]]>
-
-
- The printout of the above program will be:
-
-
+
+
+ The printout of the above program will be:
+
+
-
-
-
-
+
+
+
+
+
-
-
- gmp_pow
- Raise number into power
-
-
- Description
-
- resourcegmp_pow
- resourcebase
- intexp
-
-
- Raise base into power
- exp. The case of 0^0 yields
- 1. exp cannot be negative.
-
-
- gmp_pow example
-
+
+
+ gmp_pow
+ Raise number into power
+
+
+ Description
+
+ resourcegmp_pow
+ resourcebase
+ intexp
+
+
+ Raise base into power
+ exp. The case of 0^0 yields
+ 1. exp cannot be negative.
+
+
+ gmp_pow example
+
]]>
-
-
- The printout of the above program will be:
-
-
+
+
+ The printout of the above program will be:
+
+
-
-
-
-
+
+
+
+
+
-
-
- gmp_powm
- Raise number into power with modulo
-
-
- Description
-
- resourcegmp_powm
- resourcebase
- resourceexp
- resourcemod
-
-
- Calculate (base raised into power
- exp) modulo mod. If
- exp is negative, result is undefined.
-
-
- gmp_powm example
-
+
+
+ gmp_powm
+ Raise number into power with modulo
+
+
+ Description
+
+ resourcegmp_powm
+ resourcebase
+ resourceexp
+ resourcemod
+
+
+ Calculate (base raised into power
+ exp) modulo mod. If
+ exp is negative, result is undefined.
+
+
+ gmp_powm example
+
]]>
-
-
- The printout of the above program will be:
-
-
+
+
+ The printout of the above program will be:
+
+
-
-
-
-
+
+
+
+
+
-
-
- gmp_prob_prime
- Check if number is "probably prime"
-
-
- Description
-
- intgmp_prob_prime
- resourcea
- intreps
-
-
- If this function returns 0, a is
- definitely not prime. If it returns 1, then
- a is "probably" prime. If it returns 2,
- then a is surely prime. Reasonable values
- of reps vary from 5 to 10 (default being
- 10); a higher value lowers the probability for a non-prime to
- pass as a "probable" prime.
-
-
- The function uses Miller-Rabin's probabilistic test.
-
-
- gmp_prob_prime example
-
+
+
+ gmp_prob_prime
+ Check if number is "probably prime"
+
+
+ Description
+
+ intgmp_prob_prime
+ resourcea
+ intreps
+
+
+ If this function returns 0, a is
+ definitely not prime. If it returns 1, then
+ a is "probably" prime. If it returns 2,
+ then a is surely prime. Reasonable values
+ of reps vary from 5 to 10 (default being
+ 10); a higher value lowers the probability for a non-prime to
+ pass as a "probable" prime.
+
+
+ The function uses Miller-Rabin's probabilistic test.
+
+
+ gmp_prob_prime example
+
]]>
-
-
- The printout of the above program will be:
-
-
+
+
+ The printout of the above program will be:
+
+
-
-
-
-
+
+
+
+
+
-
-
- gmp_random
- Random number
-
-
- Description
-
- resourcegmp_random
- intlimiter
-
-
- Generate a random number. The number will be between
- zero and the number of bits per limb multiplied by
- limiter. If limiter
- is negative, negative numbers are generated.
-
-
- A limb is an internal GMP mechanism. The number of bits in a limb is
- not static, and can vary from system to system. Generally, the number
- of bits in a limb is either 16 or 32, but this is not guaranteed.
-
-
- gmp_random example
-
+
+
+ gmp_random
+ Random number
+
+
+ Description
+
+ resourcegmp_random
+ intlimiter
+
+
+ Generate a random number. The number will be between
+ zero and the number of bits per limb multiplied by
+ limiter. If limiter
+ is negative, negative numbers are generated.
+
+
+ A limb is an internal GMP mechanism. The number of bits in a limb is
+ not static, and can vary from system to system. Generally, the number
+ of bits in a limb is either 16 or 32, but this is not guaranteed.
+
+
+ gmp_random example
+
]]>
-
-
- The printout of the above program might be:
-
-
+
+
+ The printout of the above program might be:
+
+
-
-
-
-
+
+
+
+
+
-
-
- gmp_scan0
- Scan for 0
-
-
- Description
-
- intgmp_scan0
- resourcea
- intstart
-
-
- Scans a, starting with bit
- start, towards more significant bits,
- until the first clear bit is found. Returns the index of the
- found bit. The index starts from 0.
-
-
- gmp_scan0 example
-
+
+
+ gmp_scan0
+ Scan for 0
+
+
+ Description
+
+ intgmp_scan0
+ resourcea
+ intstart
+
+
+ Scans a, starting with bit
+ start, towards more significant bits,
+ until the first clear bit is found. Returns the index of the
+ found bit. The index starts from 0.
+
+
+ gmp_scan0 example
+
]]>
-
-
- The printout of the above program will be:
-
-
+
+
+ The printout of the above program will be:
+
+
-
-
-
-
+
+
+
+
+
-
-
- gmp_scan1
- Scan for 1
-
-
- Description
-
- intgmp_scan1
- resourcea
- intstart
-
-
- Scans a, starting with bit
- start, towards more significant bits,
- until the first set bit is found. Returns the index of the found
- bit. If no set bit is found, -1 is returned.
-
-
- gmp_scan1 example
-
+
+
+ gmp_scan1
+ Scan for 1
+
+
+ Description
+
+ intgmp_scan1
+ resourcea
+ intstart
+
+
+ Scans a, starting with bit
+ start, towards more significant bits,
+ until the first set bit is found. Returns the index of the found
+ bit. If no set bit is found, -1 is returned.
+
+
+ gmp_scan1 example
+
]]>
-
-
- The printout of the above program will be:
-
-
+
+
+ The printout of the above program will be:
+
+
-
-
-
-
+
+
+
+
+
-
-
- gmp_setbit
- Set bit
-
-
- Description
-
- voidgmp_setbit
- resourcea
- intindex
- boolset_clear
-
-
- Sets bit index in
- a. set_clear
- defines if the bit is set to 0 or 1. By default the bit is set to
- 1. Index starts at 0.
-
-
-
- Unlike most of the other GMP functions, gmp_setbit
- must be called with a GMP resource that already exists (using
- gmp_init for example). One will not be
- automatically created.
-
-
-
- gmp_setbit example
-
+
+
+ gmp_setbit
+ Set bit
+
+
+ Description
+
+ voidgmp_setbit
+ resourcea
+ intindex
+ boolset_clear
+
+
+ Sets bit index in
+ a. set_clear
+ defines if the bit is set to 0 or 1. By default the bit is set to
+ 1. Index starts at 0.
+
+
+
+ Unlike most of the other GMP functions, gmp_setbit
+ must be called with a GMP resource that already exists (using
+ gmp_init for example). One will not be
+ automatically created.
+
+
+
+ gmp_setbit example
+
]]>
-
-
- The printout of the above program will be:
-
-
+
+
+ The printout of the above program will be:
+
+
-
-
-
- See also gmp_clrbit and
- gmp_testbit.
-
-
-
+
+
+
+ See also gmp_clrbit and
+ gmp_testbit.
+
+
+
+
-
-
- gmp_sign
- Sign of number
-
-
- Description
-
- intgmp_sign
- resourcea
-
-
- Returns 1 if a is positive,
- -1 if a is negative,
- and 0 if a is zero.
-
-
- gmp_sign example
-
+
+
+ gmp_sign
+ Sign of number
+
+
+ Description
+
+ intgmp_sign
+ resourcea
+
+
+ Returns 1 if a is positive,
+ -1 if a is negative,
+ and 0 if a is zero.
+
+
+ gmp_sign example
+
]]>
-
-
- The printout of the above program will be:
-
-
+
+
+ The printout of the above program will be:
+
+
-
-
-
-
+
+
+
+
+
-
-
- gmp_sqrt
- Calculate square root
-
-
- Description
-
- resourcegmp_sqrt
- resourcea
-
-
- Calculates square root of a and returns the
- integer portion of the result.
-
-
- gmp_sqrt example
-
+
+
+ gmp_sqrt
+ Calculate square root
+
+
+ Description
+
+ resourcegmp_sqrt
+ resourcea
+
+
+ Calculates square root of a and returns the
+ integer portion of the result.
+
+
+ gmp_sqrt example
+
]]>
-
-
- The printout of the above program will be:
-
-
+
+
+ The printout of the above program will be:
+
+
-
-
-
-
+
+
+
+
-
-
- gmp_sqrtrem
-
- Square root with remainder
-
-
-
- Description
-
- arraygmp_sqrtrem
- resourcea
-
-
- Returns array where first element is the integer square root of
- a (see also
- gmp_sqrt), and the second is the remainder
- (i.e., the difference between a and the
- first element squared).
-
-
- gmp_sqrtrem example
-
+
+
+
+ gmp_sqrtrem
+ Square root with remainder
+
+
+ Description
+
+ arraygmp_sqrtrem
+ resourcea
+
+
+ Returns array where first element is the integer square root of
+ a (see also
+ gmp_sqrt), and the second is the remainder
+ (i.e., the difference between a and the
+ first element squared).
+
+
+ gmp_sqrtrem example
+
]]>
-
-
- The printout of the above program will be:
-
-
+
+
+ The printout of the above program will be:
+
+
-
-
-
-
+
+
+
+
+
-
-
- gmp_strval
- Convert GMP number to string
-
-
- Description
-
- stringgmp_strval
- resourcegmpnumber
- intbase
-
-
- Convert GMP number to string representation in base
- base. The default base is 10. Allowed
- values for the base are from 2 to 36.
-
-
-
- Converting a GMP number to a string
-
+
+
+ gmp_strval
+ Convert GMP number to string
+
+
+ Description
+
+ stringgmp_strval
+ resourcegmpnumber
+ intbase
+
+
+ Convert GMP number to string representation in base
+ base. The default base is 10. Allowed
+ values for the base are from 2 to 36.
+
+
+
+ Converting a GMP number to a string
+
]]>
-
-
-
-
-
+
+
+
+
+
+
-
-
- gmp_sub
- Subtract numbers
-
-
- Description
-
- resourcegmp_sub
- resourcea
- resourceb
-
-
- Subtracts b from a
- and returns the result.
-
-
- gmp_sub example
-
+
+
+ gmp_sub
+ Subtract numbers
+
+
+ Description
+
+ resourcegmp_sub
+ resourcea
+ resourceb
+
+
+ Subtracts b from a
+ and returns the result.
+
+
+ gmp_sub example
+
]]>
-
-
- The printout of the above program will be:
-
-
+
+
+ The printout of the above program will be:
+
+
-
-
-
-
+
+
+
+
+
-
-
- gmp_xor
- Logical XOR
-
-
- Description
-
- resourcegmp_xor
- resourcea
- resourceb
-
-
- Calculates logical exclusive OR (XOR) of two GMP numbers.
-
-
- gmp_xor example
-
+
+
+ gmp_xor
+ Logical XOR
+
+
+ Description
+
+ resourcegmp_xor
+ resourcea
+ resourceb
+
+
+ Calculates logical exclusive OR (XOR) of two GMP numbers.
+
+
+ gmp_xor example
+
]]>
-
-
- The printout of the above program will be:
-
-
+
+
+ The printout of the above program will be:
+
+
-
-
-
-
+
+
+
+