Uses of Class
it.unich.jgmp.MPZ
Packages that use MPZ
-
Uses of MPZ in it.unich.jgmp
Methods in it.unich.jgmp that return MPZModifier and TypeMethodDescriptionMPZ.abs()
Return anMPZ
whose value is the absolute value ofthis
.MPZ.absAssign()
Set thisMPZ
to its absolute value.Set thisMPZ
to the absolute value ofop
.Return anMPZ
whose value is(this + op)
.Set thisMPZ
to(this + op)
Set thisMPZ
to(op1 + op2)
.Return anMPZ
whose value is(this + op1 * op2)
.MPZ.addmulAssign
(MPZ op1, MPZ op2) Add(op1 * op2)
to thisMPZ
.Return anMPZ
whose value is(this + op1 * op2)
.MPZ.addmulUiAssign
(MPZ op1, long op2) Add(op1 * op2)
to thisMPZ
.MPZ.addUi
(long op) Return anMPZ
whose value is(this + op)
.MPZ.addUiAssign
(long op) Set thisMPZ
to(this + op)
MPZ.addUiAssign
(MPZ op1, long op2) Set thisMPZ
to(op1 + op2)
.Return anMPZ
whose value is(this & op)
.Set thisMPZ
to(this & op)
.Set thisMPZ
to(op1 & op2)
.MPZ.binUi
(long k) Return anMPZ
whose value is the binomial coefficientthis
overk
.MPZ.binUiAssign
(long k) Set thisMPZ
to the binomial coefficientthis
overk
.MPZ.binUiAssign
(MPZ n, long k) Set thisMPZ
to the binomial coefficientn
overk
.static MPZ
MPZ.binUiUi
(long n, long k) Return anMPZ
whose value is the binomial coefficientn
overk
.MPZ.binUiUiAssign
(long n, long k) Set thisMPZ
to the binomial coefficientn
overk
.static MPZ
MPZ.bufferImport
(int order, int size, int endian, long nails, ByteBuffer op) Return anMPZ
whose value is determined from the buffer of word data atop
.MPZ.bufferImportAssign
(int order, int size, int endian, long nails, ByteBuffer op) Set thisMPZ
from the buffer of word data atop
.Return anMPZ
whose value is the quotient of the integer division(this / d)
, rounded towards +∞.MPZ.cdivq2Exp
(long b) Return anMPZ
whose value is the quotient of the integer division(this / 2b)
, rounded towards +∞.MPZ.cdivq2ExpAssign
(long b) Set thisMPZ
to the quotient of the integer division(this / 2b)
, rounded toward +∞.MPZ.cdivq2ExpAssign
(MPZ n, long b) Set thisMPZ
to the quotient of the integer division(n / 2b)
, rounded toward +∞.MPZ.cdivqAssign
(MPZ d) Set thisMPZ
to the quotient of the integer division(this / d)
, rounded towards +∞.MPZ.cdivqAssign
(MPZ n, MPZ d) Set thisMPZ
to the quotient of the integer division(n / d)
, rounded towards +∞.MPZ.cdivqrAssign
(MPZ r, MPZ d) Set thisMPZ
andr
to the quotient and remainder of the integer division(this / d)
, rounded towards +∞.MPZ.cdivqrAssign
(MPZ r, MPZ n, MPZ d) Set thisMPZ
andr
to the quotient and remainder of the integer division(n / d)
, rounded towards +∞.Return anMPZ
whose value is the remainder of the integer division(this / d)
, rounded towards +∞.MPZ.cdivr2Exp
(long b) Return anMPZ
whose value is the remainder of the integer division(this / 2b)
, rounded towards +∞.MPZ.cdivr2ExpAssign
(long b) Set thisMPZ
to the remainder of the integer division(this / 2b)
, rounded toward +∞.MPZ.cdivr2ExpAssign
(MPZ n, long b) Set thisMPZ
to the remainder of the integer division(n / 2b)
, rounded toward +∞.MPZ.cdivrAssign
(MPZ d) Set thisMPZ
to the remainder of the integer division(this / d)
, rounded towards +∞.MPZ.cdivrAssign
(MPZ n, MPZ d) Set thisMPZ
to the remainder of the integer division(n / d)
, rounded towards +∞.MPZ.clrbit
(long index) Return anMPZ
whose value is(this & ~ 2index)
.MPZ.clrbitAssign
(long index) Clear the bitindex
of thisMPZ
.MPZ.com()
Return anMPZ
whose value is(~ op)
.MPZ.comAssign()
Set thisMPZ
to(~ this)
.Set thisMPZ
to(~ op)
.MPZ.combit
(long index) Return anMPZ
whose value is(this ^ 2index)
.MPZ.combitAssign
(long index) Complement the bitindex
of thisMPZ
.static MPZ
MPZ.dfacUi
(long n) Return anMPZ
whose value the double factorial ofn
.MPZ.dfacUiAssign
(long n) Set thisMPZ
to the double factorial ofn
.Return anMPZ
whose value is the quotient of(this / d)
.MPZ.divexactAssign
(MPZ d) Set thisMPZ
to the quotient of(this / d)
.MPZ.divexactAssign
(MPZ n, MPZ d) Set thisMPZ
to the quotient of(n / d)
.MPZ.divexactUi
(long d) Return anMPZ
whose value is the quotient of(this / d)
.MPZ.divexactUiAssign
(long d) Set thisMPZ
to the quotient of(this / d)
.MPZ.divexactUiAssign
(MPZ n, long d) Set thisMPZ
to the quotient of(n / d)
.static MPZ
MPZ.facUi
(long n) Return anMPZ
whose value is the factorial ofn
.MPZ.facUiAssign
(long n) Set thisMPZ
to the factorial ofn
.Return anMPZ
whose value is the quotient of the integer division(this / d)
, rounded towards -∞.MPZ.fdivq2Exp
(long b) Return anMPZ
whose value is the quotient of the integer division(this / 2b)
, rounded towards -∞.MPZ.fdivq2ExpAssign
(long b) Set thisMPZ
to the quotient of the integer division(this / 2b)
, rounded toward -∞.MPZ.fdivq2ExpAssign
(MPZ n, long b) Set thisMPZ
to the quotient of the integer division(n / 2b)
, rounded toward -∞.MPZ.fdivqAssign
(MPZ d) Set thisMPZ
to the quotient of the integer division(this / d)
, rounded towards -∞.MPZ.fdivqAssign
(MPZ n, MPZ d) Set thisMPZ
to the quotient of the integer division(n / d)
, rounded towards -∞.MPZ.fdivqrAssign
(MPZ r, MPZ d) Set thisMPZ
andr
to the quotient and remainder of the integer division(this / d)
, rounded towards -∞.MPZ.fdivqrAssign
(MPZ r, MPZ n, MPZ d) Set thisMPZ
andr
to the quotient and remainder of the integer division(n / d)
, rounded towards -∞.Return anMPZ
whose value is the remainder of the integer division(this / d)
, rounded towards -∞.MPZ.fdivr2Exp
(long b) Return anMPZ
whose value is the remainder of the integer division(this / 2b)
, rounded towards -∞.MPZ.fdivr2ExpAssign
(long b) Set thisMPZ
to the remainder of the integer division(this / 2b)
, rounded toward -∞.MPZ.fdivr2ExpAssign
(MPZ n, long b) Set thisMPZ
to the remainder of the integer division(n / 2b)
, rounded toward -∞.MPZ.fdivrAssign
(MPZ d) Set thisMPZ
to the remainder of the integer division(this / d)
, rounded towards -∞.MPZ.fdivrAssign
(MPZ n, MPZ d) Set thisMPZ
to the remainder of the integer division(n / d)
, rounded towards -∞.MPZ.fib2UiAssign
(MPZ fnsub1, long n) Set the value ofthis
andfnsub1
to then
-th and(n-1)
-th Fibonacci numbers respecively.static MPZ
MPZ.fibUi
(long n) Return anMPZ
whose value is then
-th Fibonacci number.MPZ.fibUiAssign
(long n) Set thisMPZ
to then
-th Fibonacci number.Return anMPZ
whose value is the greatest commond divisor ofthis
andop
.Set thisMPZ
to the greatest commond divisor ofthis
andop
.Set thisMPZ
to the greatest commond divisor ofop1
andop2
.MPZ.gcdextAssign
(MPZ s, MPZ t, MPZ op) Set thisMPZ
to the greatest common divisor ofthis
andop
, and in addition Sets
andt
to coefficients satisfying(this*s + op*t = gcd)
.MPZ.gcdextAssign
(MPZ s, MPZ t, MPZ a, MPZ b) Set thisMPZ
to the greatest common divisor ofa
andb
, and in addition Sets
andt
to coefficients satisfying(a*s + b*t = gcd)
.MPQ.getDen()
Return the denominator ofthis
.MPQ.getNum()
Return the numerator ofthis
.static MPZ
MPZ.init()
Return anMPZ
whose value is zero.static MPZ
MPZ.init2
(long n) Return anMPZ
whose value is zero, with pre-allocated space forn
-bit numbers.static MPZ
MPZ.initSet
(double op) Return anMPZ
whose value is the truncation ofop
.static MPZ
MPZ.initSet
(long op) Return anMPZ
whose value isop
.static MPZ
Return anMPZ
whose value isop
.static MPZ
MPZ.initSetUi
(long op) Return anMPZ
whose value isop
.Return anMPZ
whose value is(this | op)
.Set thisMPZ
to(this | op)
.Set thisMPZ
to(op1 | op2)
.Return anMPZ
whose value is the least common multiple ofthis
andop
.Set thisMPZ
to the least common multiple ofthis
andop
.Set thisMPZ
to the least common multiple ofop1
andop2
.MPZ.lcmUi
(long op) Return the least common multiple ofthis
andop
.MPZ.lcmUiAssign
(long op) Set thisMPZ
to the least common multiple ofthis
andop
.MPZ.lcmUiAssign
(MPZ op1, long op2) Set thisMPZ
to the least common multiple ofop1
andop2
.MPZ.lucnum2UiAssign
(MPZ fnsub1, long n) Set the value ofthis
andfnsub1
to then
-th and(n-1)
-th Lucas numbers respecively.static MPZ
MPZ.lucnumUi
(long n) Return anMPZ
whose value is then
-th Lucas number.MPZ.lucnumUiAssign
(long n) Set thisMPZ
to then
-th Lucas number.static MPZ
MPZ.mfacUiUi
(long n, long m) Return anMPZ
whose value is them
-multi factorial ofn
.MPZ.mfacUiUiAssign
(long n, long m) Set thisMPZ
to them
-multi factorial ofn
.Return anMPZ
whose value is(this mod d)
.Set thisMPZ
to(this mod d)
.Set thisMPZ
to(n mod d)
.MPZ.mul
(long op) Return anMPZ
whose value is(this * op)
.Return anMPZ
whose value is(this * op)
.MPZ.mul2Exp
(long b) Return anMPZ
whose value is(this * 2b)
.MPZ.mul2ExpAssign
(long b) Set thisMPZ
to(this * 2b)
.MPZ.mul2ExpAssign
(MPZ op, long b) Set thisMPZ
to(op * 2b)
.MPZ.mulAssign
(long op) Set thisMPZ
to(this * op)
Set thisMPZ
to(this * op)
Set thisMPZ
to(op1 * op2)
.Set thisMPZ
to(op1 * op2)
.MPZ.mulUi
(long op) Return anMPZ
whose value is(this * op)
.MPZ.mulUiAssign
(long op) Set thisMPZ
to(this * op)
MPZ.mulUiAssign
(MPZ op1, long op2) Set thisMPZ
to(op1 * op2)
.MPZ.neg()
Return anMPZ
whose value is the quotient of(- this)
.MPZ.negAssign()
Set thisMPZ
to its opposite.Set thisMPZ
to(- op)
.MPZ.nextprime()
Return anMPZ
whose value is the next prime greater thenthis
.MPZ.nextprimeAssign()
Set thisMPZ
to the next prime greater then itself.MPZ.nextprimeAssign
(MPZ op) Set thisMPZ
to the next prime greater thenop
.Return anMPZ
whose value is(thisexp)
modulomod
.MPZ.powmAssign
(MPZ exp, MPZ mod) Set thisMPZ
to(thisexp)
modulomod
.MPZ.powmAssign
(MPZ base, MPZ exp, MPZ mod) Set thisMPZ
to(baseexp)
modulomod
.Return anMPZ
whose value is(thisexp)
modulomod
.MPZ.powmSecAssign
(MPZ exp, MPZ mod) Set thisMPZ
to(thisexp)
modulomod
.MPZ.powmSecAssign
(MPZ base, MPZ exp, MPZ mod) Set thisMPZ
to(baseexp)
modulomod
.Return anMPZ
whose value is(thisexp)
modulomod
.MPZ.powmUiAssign
(long exp, MPZ mod) Set thisMPZ
to(thisexp)
modulomod
.MPZ.powmUiAssign
(MPZ base, long exp, MPZ mod) Set thisMPZ
to(baseexp)
modulomod
.MPZ.powUi
(long exp) Return anMPZ
whose value is(thisexp)
.static MPZ
MPZ.powUi
(long base, long exp) Return anMPZ
whose value is(baseexp)
.MPZ.powUiAssign
(long exp) Set thisMPZ
to(thisexp)
.MPZ.powUiAssign
(long base, long exp) Set thisMPZ
to(baseexp)
.MPZ.powUiAssign
(MPZ base, long exp) Set thisMPZ
to(baseexp)
.static MPZ
MPZ.primorialUi
(long n) Return anMPZ
whose value is the primorial ofn
, i.e., the product of all positive prime numbers<= n
.MPZ.primorialUiAssign
(long n) Set thisMPZ
to the primorial ofn
, i.e., the product of all positive prime numbers<= n
.static MPZ
MPZ.random
(long max_size) Deprecated.static MPZ
MPZ.random2
(long max_size) Deprecated.userrandomb(it.unich.jgmp.RandState,long)
instead, since this method uses a global random state and it is not reentrant.MPZ.random2Assign
(long max_size) Deprecated.userrandombAssign(it.unich.jgmp.RandState,long)
instead, since this method uses a global random state and it is not reentrant.MPZ.randomAssign
(long max_size) Deprecated.useurandombAssign(it.unich.jgmp.RandState,long)
orurandommAssign(it.unich.jgmp.RandState,it.unich.jgmp.MPZ)
instead, since this method uses a global random state and it is not reentrant.MPZ.realloc2
(long n) Changes the space allocated for this number ton
bits.MPZ.rootremAssign
(MPZ rem, long n) Set thisMPZ
to the truncated integer part of the itsn
th root andrem
to the remainder, i.e.,(this - rootn)
.MPZ.rootremAssign
(MPZ rem, MPZ u, long n) Set thisMPZ
to the truncated integer part of then
th root ofu
andrem
to the remainder, i.e.,(u - rootn)
.static MPZ
Return anMPZ
whose value is a random integer with long strings of zeros and ones in the binary representation.MPZ.rrandombAssign
(RandState s, long n) Set thisMPZ
to a random integer with long strings of zeros and ones in the binary representation.MPZ.set
(double op) Set thisMPZ
to the truncation ofop
.MPZ.set
(long op) Set thisMPZ
toop
.Set thisMPZ
to the truncation ofop
.Set thisMPZ
to the truncation ofop
.Set thisMPZ
toop
.MPZ.set
(BigInteger op) Sets thisMPZ
toop
.MPZ.setbit
(long index) Return anMPZ
whose value is(this | 2index)
.MPZ.setbitAssign
(long index) Set the bitindex
of thisMPZ
.MPZ.setUi
(long op) Set thisMPZ
toop
.MPZ.setValue
(double op) Set thisMPZ
to the truncation opop
.MPZ.setValue
(long op) Set thisMPZ
to signed longop
.Set thisMPZ
to the truncation opop
.Set thisMPZ
to the truncation opop
.Set thisMPZ
toop
.Set thisMPZ
to the value represented by the stringstr
in decimal base.Set thisMPZ
to the number represented by the stringstr
in the specifiedbase
.MPZ.setValue
(BigInteger op) Sets thisMPZ
toop
.MPZ.sqrt()
Return anMPZ
whose value is the truncated integer part of the square root ofthis
.MPZ.sqrtAssign()
Set thisMPZ
to the truncated integer part of its square root.MPZ.sqrtAssign
(MPZ op) Set thisMPZ
to the truncated integer part of the square root ofop
.MPZ.sqrtremAssign
(MPZ rem) Set thisMPZ
to the truncated integer part of its square root andrem
to the remainder, i.e.,(this - root2)
.MPZ.sqrtremAssign
(MPZ rem, MPZ op) Set thisMPZ
to the truncated integer part of the square root ofop
andrem
to the remainder, i.e.,(op - root2)
.Return anMPZ
whose value is(this - op)
.Set thisMPZ
to(this - op)
Set thisMPZ
to(op1 - op2)
.Return anMPZ
whose value is(this - op1 * op2)
.MPZ.submulAssign
(MPZ op1, MPZ op2) Subtract(op1 * op2)
to thisMPZ
.Return anMPZ
whose value is(this - op1 * op2)
.MPZ.submulUiAssign
(MPZ op1, long op2) Subtract(op1 * op2)
to thisMPZ
.MPZ.subUi
(long op) Return anMPZ
whose value is(this - op)
.MPZ.subUiAssign
(long op) Set thisMPZ
to(this - op)
MPZ.subUiAssign
(MPZ op1, long op2) Set thisMPZ
to(op1 - op2)
.Swap the value of thisMPZ
with the value ofop
.Return anMPZ
whose value is the quotient of the integer division(this / d)
, rounded towards zero.MPZ.tdivq2Exp
(long b) Return anMPZ
whose value is the quotient of the integer division(this / 2b)
, rounded towards zero.MPZ.tdivq2ExpAssign
(long b) Set thisMPZ
to the quotient of the integer division(this / 2b)
, rounded toward zero.MPZ.tdivq2ExpAssign
(MPZ n, long b) Set thisMPZ
to the quotient of the integer division(n / 2b)
, rounded toward zero.MPZ.tdivqAssign
(MPZ d) Set thisMPZ
to the quotient of the integer division(this / d)
, rounded towards zero.MPZ.tdivqAssign
(MPZ n, MPZ d) Set thisMPZ
to the quotient of the integer division(n / d)
, rounded towards zero.MPZ.tdivqrAssign
(MPZ r, MPZ d) Set thisMPZ
andr
to the quotient and remainder of the integer division(this / d)
, rounded towards zero.MPZ.tdivqrAssign
(MPZ r, MPZ n, MPZ d) Set thisMPZ
andr
to the quotient and remainder of the integer division(n / d)
, rounded towards zero.Return anMPZ
whose value is the remainder of the integer division(this / d)
, rounded towards zero.MPZ.tdivr2Exp
(long b) Return anMPZ
whose value is the remainder of the integer division(this / 2b)
, rounded towards zero.MPZ.tdivr2ExpAssign
(long b) Set thisMPZ
to the remainder of the integer division(this / 2b)
, rounded toward zero.MPZ.tdivr2ExpAssign
(MPZ n, long b) Set thisMPZ
to the remainder of the integer division(n / 2b)
, rounded toward zero.MPZ.tdivrAssign
(MPZ d) Set thisMPZ
to the remainder of the integer division(this / d)
, rounded towards zero.MPZ.tdivrAssign
(MPZ n, MPZ d) Set thisMPZ
to the remainder of the integer division(n / d)
, rounded towards zero.MPZ.uiSub
(long op) Return anMPZ
whose value is(op - this)
.MPZ.uiSubAssign
(long op) Set thisMPZ
to(op - this)
MPZ.uiSubAssign
(long op1, MPZ op2) Set thisMPZ
to(op1 - op2)
.static MPZ
Return anMPZ
whose value is an uniformly distributed random integer in the range0
} to(2n - 1)
, inclusive.MPZ.urandombAssign
(RandState s, long n) Set thisMPZ
to a uniformly distributed random integer in the range0
to(2n - 1)
, inclusive.static MPZ
Return anMPZ
whose value is an uniformly distributed random integer in the range0
to(n - 1)
, inclusive.MPZ.urandommAssign
(RandState s, MPZ n) Set thisMPZ
to a uniformly distributed random integer in the range0
to(n - 1)
, inclusive.Return anMPZ
whose value is(this ^ op)
.Set thisMPZ
to(this ^ op)
.Set thisMPZ
to(op1 ^ op2)
.Methods in it.unich.jgmp that return types with arguments of type MPZModifier and TypeMethodDescriptionReturn a pair ofMPZ
s whose values are the quotient and remainder of the integer division(this / d)
, rounded towards +∞.Return a pair ofMPZ
s whose values are the quotient and remainder of the integer division(this / d)
, rounded towards +∞.Return twoMPZ
s whose values are the quotient and remainder of the integer division(this / d)
, rounded towards -∞.Return twoMPZ
s whose values are the quotient and remainder of the integer division(this / d)
, rounded towards -∞.MPZ.fib2Ui
(long n) Return twoMPZ
whose values are then
-th and(n-1)
-th Fibonacci numbers.MPZ.fib2Ui
(long n) Return twoMPZ
whose values are then
-th and(n-1)
-th Fibonacci numbers.Return the greatest common divisor ofthis
andop
, together with numberss
andt
satisfying(a*this + b*op = g)
See the GMP functionmpz_gcdext
.Return the greatest common divisor ofthis
andop
, together with numberss
andt
satisfying(a*this + b*op = g)
See the GMP functionmpz_gcdext
.Return the greatest common divisor ofthis
andop
, together with numberss
andt
satisfying(a*this + b*op = g)
See the GMP functionmpz_gcdext
.Return anMPZ
whose value is the number represented by the stringstr
in the specifiedbase
.Optionally return, when it exists, anMPZ
whose value is the inverse ofthis
moduloop
.MPZ.lucnum2Ui
(long n) Return twoMPZ
whose values are then
-th and(n-1)
-th Lucas numbers.MPZ.lucnum2Ui
(long n) Return twoMPZ
whose values are then
-th and(n-1)
-th Lucas numbers.Return the result of removing the factorf
fromthis
, together with the number of occurrences which were removed.MPZ.root
(long n) Return anMPZ
whose value is the truncated integer part of then
th root ofthis
, and a boolean flag which is true when the result is exact.MPZ.rootrem
(long n) Return twoMPZ
s whose values are the truncated integer part of then
th root ofthis
and the remainder, i.e.,(u - rootn)
.MPZ.rootrem
(long n) Return twoMPZ
s whose values are the truncated integer part of then
th root ofthis
and the remainder, i.e.,(u - rootn)
.MPZ.sqrtrem()
Return twoMPZ
s whose values are the truncated integer part of the square root ofthis
and the remainder, i.e.,(op - root2)
.MPZ.sqrtrem()
Return twoMPZ
s whose values are the truncated integer part of the square root ofthis
and the remainder, i.e.,(op - root2)
.Return twoMPZ
s whose values are the quotient and remainder of the integer division(this / d)
, rounded towards zero.Return twoMPZ
s whose values are the quotient and remainder of the integer division(this / d)
, rounded towards zero.Methods in it.unich.jgmp with parameters of type MPZModifier and TypeMethodDescriptionSet thisMPZ
to the absolute value ofop
.Return anMPZ
whose value is(this + op)
.Set thisMPZ
to(this + op)
Set thisMPZ
to(op1 + op2)
.Return anMPZ
whose value is(this + op1 * op2)
.MPZ.addmulAssign
(MPZ op1, MPZ op2) Add(op1 * op2)
to thisMPZ
.Return anMPZ
whose value is(this + op1 * op2)
.MPZ.addmulUiAssign
(MPZ op1, long op2) Add(op1 * op2)
to thisMPZ
.MPZ.addUiAssign
(MPZ op1, long op2) Set thisMPZ
to(op1 + op2)
.Return anMPZ
whose value is(this & op)
.Set thisMPZ
to(this & op)
.Set thisMPZ
to(op1 & op2)
.MPZ.binUiAssign
(MPZ n, long k) Set thisMPZ
to the binomial coefficientn
overk
.Return anMPZ
whose value is the quotient of the integer division(this / d)
, rounded towards +∞.MPZ.cdivq2ExpAssign
(MPZ n, long b) Set thisMPZ
to the quotient of the integer division(n / 2b)
, rounded toward +∞.MPZ.cdivqAssign
(MPZ d) Set thisMPZ
to the quotient of the integer division(this / d)
, rounded towards +∞.MPZ.cdivqAssign
(MPZ n, MPZ d) Set thisMPZ
to the quotient of the integer division(n / d)
, rounded towards +∞.Return a pair ofMPZ
s whose values are the quotient and remainder of the integer division(this / d)
, rounded towards +∞.MPZ.cdivqrAssign
(MPZ r, MPZ d) Set thisMPZ
andr
to the quotient and remainder of the integer division(this / d)
, rounded towards +∞.MPZ.cdivqrAssign
(MPZ r, MPZ n, MPZ d) Set thisMPZ
andr
to the quotient and remainder of the integer division(n / d)
, rounded towards +∞.long
MPZ.cdivqrUiAssign
(MPZ r, long d) Set thisMPZ
andr
to the quotient and remainder of the integer division(this / d)
, rounded towards +∞; it also returns the remainder.long
MPZ.cdivqrUiAssign
(MPZ r, MPZ n, long d) Set thisMPZ
andr
to the quotient and remainder of the integer division(n / d)
, rounded towards +∞; it also returns the remainder.long
MPZ.cdivqUiAssign
(MPZ n, long d) Set thisMPZ
to the quotient of the integer division(n / d)
, rounded towards +∞; it also Return the remainder.Return anMPZ
whose value is the remainder of the integer division(this / d)
, rounded towards +∞.MPZ.cdivr2ExpAssign
(MPZ n, long b) Set thisMPZ
to the remainder of the integer division(n / 2b)
, rounded toward +∞.MPZ.cdivrAssign
(MPZ d) Set thisMPZ
to the remainder of the integer division(this / d)
, rounded towards +∞.MPZ.cdivrAssign
(MPZ n, MPZ d) Set thisMPZ
to the remainder of the integer division(n / d)
, rounded towards +∞.long
MPZ.cdivrUiAssign
(MPZ n, long d) Set thisMPZ
to the remainder of the integer division(n / d)
, rounded towards +∞; it also returns the remainder.int
Comparethis
withop
.int
Comparethis
withop
.int
Comparethis
withop
.int
Compare the absolute values ofthis
andop
.Set thisMPZ
to(~ op)
.int
Compare thisMPZ
withop
.Return anMPZ
whose value is the quotient of(this / d)
.MPZ.divexactAssign
(MPZ d) Set thisMPZ
to the quotient of(this / d)
.MPZ.divexactAssign
(MPZ n, MPZ d) Set thisMPZ
to the quotient of(n / d)
.MPZ.divexactUiAssign
(MPZ n, long d) Set thisMPZ
to the quotient of(n / d)
.Return anMPZ
whose value is the quotient of the integer division(this / d)
, rounded towards -∞.MPZ.fdivq2ExpAssign
(MPZ n, long b) Set thisMPZ
to the quotient of the integer division(n / 2b)
, rounded toward -∞.MPZ.fdivqAssign
(MPZ d) Set thisMPZ
to the quotient of the integer division(this / d)
, rounded towards -∞.MPZ.fdivqAssign
(MPZ n, MPZ d) Set thisMPZ
to the quotient of the integer division(n / d)
, rounded towards -∞.Return twoMPZ
s whose values are the quotient and remainder of the integer division(this / d)
, rounded towards -∞.MPZ.fdivqrAssign
(MPZ r, MPZ d) Set thisMPZ
andr
to the quotient and remainder of the integer division(this / d)
, rounded towards -∞.MPZ.fdivqrAssign
(MPZ r, MPZ n, MPZ d) Set thisMPZ
andr
to the quotient and remainder of the integer division(n / d)
, rounded towards -∞.long
MPZ.fdivqrUiAssign
(MPZ r, long d) Set thisMPZ
andr
to the quotient and remainder of the integer division(this / d)
, rounded towards -∞; it also returns the absolute value of the remainder.long
MPZ.fdivqrUiAssign
(MPZ r, MPZ n, long d) Set thisMPZ
andr
to the quotient and remainder of the integer division(n / d)
, rounded towards -∞; it also returns the absolute value of the remainder.long
MPZ.fdivqUiAssign
(MPZ n, long d) Set thisMPZ
to the quotient of the integer division(n / d)
, rounded towards -∞; it also returns the absolute value of the remainder.Return anMPZ
whose value is the remainder of the integer division(this / d)
, rounded towards -∞.MPZ.fdivr2ExpAssign
(MPZ n, long b) Set thisMPZ
to the remainder of the integer division(n / 2b)
, rounded toward -∞.MPZ.fdivrAssign
(MPZ d) Set thisMPZ
to the remainder of the integer division(this / d)
, rounded towards -∞.MPZ.fdivrAssign
(MPZ n, MPZ d) Set thisMPZ
to the remainder of the integer division(n / d)
, rounded towards -∞.long
MPZ.fdivrUiAssign
(MPZ n, long d) Set thisMPZ
to the remainder of the integer division(n / d)
, rounded towards -∞; it also returns the absolute value of the remainder.MPZ.fib2UiAssign
(MPZ fnsub1, long n) Set the value ofthis
andfnsub1
to then
-th and(n-1)
-th Fibonacci numbers respecively.Return anMPZ
whose value is the greatest commond divisor ofthis
andop
.Set thisMPZ
to the greatest commond divisor ofthis
andop
.Set thisMPZ
to the greatest commond divisor ofop1
andop2
.Return the greatest common divisor ofthis
andop
, together with numberss
andt
satisfying(a*this + b*op = g)
See the GMP functionmpz_gcdext
.MPZ.gcdextAssign
(MPZ s, MPZ t, MPZ op) Set thisMPZ
to the greatest common divisor ofthis
andop
, and in addition Sets
andt
to coefficients satisfying(this*s + op*t = gcd)
.MPZ.gcdextAssign
(MPZ s, MPZ t, MPZ a, MPZ b) Set thisMPZ
to the greatest common divisor ofa
andb
, and in addition Sets
andt
to coefficients satisfying(a*s + b*t = gcd)
.long
MPZ.gcdUiAssign
(MPZ op1, long op2) Set thisMPZ
to the greatest commond divisor ofop1
andop2
, and return it.long
Ifthis
andop
are both>= 0
or both< 0
, return the Hamming distance between them, which is the number of bit positions wherethis
andop
have different bit values.static MPZ
Return anMPZ
whose value isop
.Optionally return, when it exists, anMPZ
whose value is the inverse ofthis
moduloop
.boolean
MPZ.invertAssign
(MPZ op) Set thisMPZ
to the inverse ofthis
moduloop
.boolean
MPZ.invertAssign
(MPZ op1, MPZ op2) Set thisMPZ
to the inverse ofop1
moduloop2
.Return anMPZ
whose value is(this | op)
.Set thisMPZ
to(this | op)
.Set thisMPZ
to(op1 | op2)
.boolean
MPZ.isCongruent
(MPZ c, MPZ d) Returntrue
if and only ifthis
is congruent toc
modulod
.boolean
MPZ.isCongruent2Exp
(MPZ c, long b) Returntrue
if and only ifthis
is congruent toc
modulo2b
.boolean
MPZ.isDivisible
(MPZ d) Returntrue
if and only ifthis
is exactly divisible byd
.int
Return the Jacobi symbol(this / b)
.int
Return the Jacobi symbol(this / n)
with the Kronecker extension(this/2)=(2/this)
whenthis
is odd, or(this/2)=0
whenthis
is even.Return anMPZ
whose value is the least common multiple ofthis
andop
.Set thisMPZ
to the least common multiple ofthis
andop
.Set thisMPZ
to the least common multiple ofop1
andop2
.MPZ.lcmUiAssign
(MPZ op1, long op2) Set thisMPZ
to the least common multiple ofop1
andop2
.int
Return the Legendre symbol(this / p)
.MPZ.lucnum2UiAssign
(MPZ fnsub1, long n) Set the value ofthis
andfnsub1
to then
-th and(n-1)
-th Lucas numbers respecively.Return anMPZ
whose value is(this mod d)
.Set thisMPZ
to(this mod d)
.Set thisMPZ
to(n mod d)
.long
MPZ.modUiAssign
(MPZ n, long d) Set thisMPZ
to(n mod d)
; it also returns the result.Return anMPZ
whose value is(this * op)
.MPZ.mul2ExpAssign
(MPZ op, long b) Set thisMPZ
to(op * 2b)
.Set thisMPZ
to(this * op)
Set thisMPZ
to(op1 * op2)
.Set thisMPZ
to(op1 * op2)
.MPZ.mulUiAssign
(MPZ op1, long op2) Set thisMPZ
to(op1 * op2)
.Set thisMPZ
to(- op)
.MPZ.nextprimeAssign
(MPZ op) Set thisMPZ
to the next prime greater thenop
.Return anMPZ
whose value is(thisexp)
modulomod
.MPZ.powmAssign
(MPZ exp, MPZ mod) Set thisMPZ
to(thisexp)
modulomod
.MPZ.powmAssign
(MPZ base, MPZ exp, MPZ mod) Set thisMPZ
to(baseexp)
modulomod
.Return anMPZ
whose value is(thisexp)
modulomod
.MPZ.powmSecAssign
(MPZ exp, MPZ mod) Set thisMPZ
to(thisexp)
modulomod
.MPZ.powmSecAssign
(MPZ base, MPZ exp, MPZ mod) Set thisMPZ
to(baseexp)
modulomod
.Return anMPZ
whose value is(thisexp)
modulomod
.MPZ.powmUiAssign
(long exp, MPZ mod) Set thisMPZ
to(thisexp)
modulomod
.MPZ.powmUiAssign
(MPZ base, long exp, MPZ mod) Set thisMPZ
to(baseexp)
modulomod
.MPZ.powUiAssign
(MPZ base, long exp) Set thisMPZ
to(baseexp)
.static RandState
RandState.randinitLc2Exp
(MPZ a, long c, long m2exp) Returns a random state for a linear congruential algorithm.Sets an initial seed value into this.Return the result of removing the factorf
fromthis
, together with the number of occurrences which were removed.long
MPZ.removeAssign
(MPZ f) Remove all occurrences of the factorf
fromthis
MPZ.long
MPZ.removeAssign
(MPZ op, MPZ f) Remove all occurrences of the factorf
fromop
and stores the result in thisMPZ
.boolean
MPZ.rootAssign
(MPZ op, long n) Set thisMPZ
to the truncated integer part of then
th root ofop
.MPZ.rootremAssign
(MPZ rem, long n) Set thisMPZ
to the truncated integer part of the itsn
th root andrem
to the remainder, i.e.,(this - rootn)
.MPZ.rootremAssign
(MPZ rem, MPZ u, long n) Set thisMPZ
to the truncated integer part of then
th root ofu
andrem
to the remainder, i.e.,(u - rootn)
.Set thisMPF
toop
, possibly truncated according to precision.Set thisMPQ
toop
.Set thisMPZ
toop
.Set the denominator ofthis
to the valueden
.Set the numerator ofthis
to the valuenum
.Set thisMPF
toop
, possibly truncated according to precision.Set thisMPZ
toop
.MPZ.sqrtAssign
(MPZ op) Set thisMPZ
to the truncated integer part of the square root ofop
.MPZ.sqrtremAssign
(MPZ rem) Set thisMPZ
to the truncated integer part of its square root andrem
to the remainder, i.e.,(this - root2)
.MPZ.sqrtremAssign
(MPZ rem, MPZ op) Set thisMPZ
to the truncated integer part of the square root ofop
andrem
to the remainder, i.e.,(op - root2)
.Return anMPZ
whose value is(this - op)
.Set thisMPZ
to(this - op)
Set thisMPZ
to(op1 - op2)
.Return anMPZ
whose value is(this - op1 * op2)
.MPZ.submulAssign
(MPZ op1, MPZ op2) Subtract(op1 * op2)
to thisMPZ
.Return anMPZ
whose value is(this - op1 * op2)
.MPZ.submulUiAssign
(MPZ op1, long op2) Subtract(op1 * op2)
to thisMPZ
.MPZ.subUiAssign
(MPZ op1, long op2) Set thisMPZ
to(op1 - op2)
.Swap the value of thisMPZ
with the value ofop
.Return anMPZ
whose value is the quotient of the integer division(this / d)
, rounded towards zero.MPZ.tdivq2ExpAssign
(MPZ n, long b) Set thisMPZ
to the quotient of the integer division(n / 2b)
, rounded toward zero.MPZ.tdivqAssign
(MPZ d) Set thisMPZ
to the quotient of the integer division(this / d)
, rounded towards zero.MPZ.tdivqAssign
(MPZ n, MPZ d) Set thisMPZ
to the quotient of the integer division(n / d)
, rounded towards zero.Return twoMPZ
s whose values are the quotient and remainder of the integer division(this / d)
, rounded towards zero.MPZ.tdivqrAssign
(MPZ r, MPZ d) Set thisMPZ
andr
to the quotient and remainder of the integer division(this / d)
, rounded towards zero.MPZ.tdivqrAssign
(MPZ r, MPZ n, MPZ d) Set thisMPZ
andr
to the quotient and remainder of the integer division(n / d)
, rounded towards zero.long
MPZ.tdivqrUiAssign
(MPZ r, long d) Set thisMPZ
andr
to the quotient and remainder of the integer division(this / d)
, rounded towards zero; it also returns the absolute value of the remainder.long
MPZ.tdivqrUiAssign
(MPZ r, MPZ n, long d) Set thisMPZ
andr
to the quotient and remainder of the integer division(n / d)
, rounded towards zero; it also returns the absolute value of the remainder.long
MPZ.tdivqUiAssign
(MPZ n, long d) Set thisMPZ
to the quotient of the integer division(n / d)
, rounded towards zero; it also returns the absolute value of the remainder.Return anMPZ
whose value is the remainder of the integer division(this / d)
, rounded towards zero.MPZ.tdivr2ExpAssign
(MPZ n, long b) Set thisMPZ
to the remainder of the integer division(n / 2b)
, rounded toward zero.MPZ.tdivrAssign
(MPZ d) Set thisMPZ
to the remainder of the integer division(this / d)
, rounded towards zero.MPZ.tdivrAssign
(MPZ n, MPZ d) Set thisMPZ
to the remainder of the integer division(n / d)
, rounded towards zero.long
MPZ.tdivrUiAssign
(MPZ n, long d) Set thisMPZ
to the remainder of the integer division(n / d)
, rounded towards zero; it also returns the absolute value of the remainder.MPZ.uiSubAssign
(long op1, MPZ op2) Set thisMPZ
to(op1 - op2)
.static MPZ
Return anMPZ
whose value is an uniformly distributed random integer in the range0
to(n - 1)
, inclusive.MPZ.urandommAssign
(RandState s, MPZ n) Set thisMPZ
to a uniformly distributed random integer in the range0
to(n - 1)
, inclusive.Return anMPZ
whose value is(this ^ op)
.Set thisMPZ
to(this ^ op)
.Set thisMPZ
to(op1 ^ op2)
.Constructors in it.unich.jgmp with parameters of type MPZ
urandomb(it.unich.jgmp.RandState,long)
orurandomm(it.unich.jgmp.RandState,it.unich.jgmp.MPZ)
instead, since this method uses a global random state and it is not reentrant.