📄 biginteger.html
字号:
public <A HREF="../../java/math/BigInteger.html">BigInteger</A> <B>remainder</B>(<A HREF="../../java/math/BigInteger.html">BigInteger</A> val)</PRE><DL><DD>Returns a BigInteger whose value is <tt>(this % val)</tt>.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>val</CODE> - value by which this BigInteger is to be divided, and the remainder computed.<DT><B>Returns:</B><DD><tt>this % val</tt><DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/ArithmeticException.html">ArithmeticException</A></CODE> - <tt>val==0</tt></DL></DD></DL><HR><A NAME="pow(int)"><!-- --></A><H3>pow</H3><PRE>public <A HREF="../../java/math/BigInteger.html">BigInteger</A> <B>pow</B>(int exponent)</PRE><DL><DD>Returns a BigInteger whose value is <tt>(this<sup>exponent</sup>)</tt>. Note that <tt>exponent</tt> is an integer rather than a BigInteger.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>exponent</CODE> - exponent to which this BigInteger is to be raised.<DT><B>Returns:</B><DD><tt>this<sup>exponent</sup></tt><DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/ArithmeticException.html">ArithmeticException</A></CODE> - <tt>exponent</tt> is negative. (This would cause the operation to yield a non-integer value.)</DL></DD></DL><HR><A NAME="gcd(java.math.BigInteger)"><!-- --></A><H3>gcd</H3><PRE>public <A HREF="../../java/math/BigInteger.html">BigInteger</A> <B>gcd</B>(<A HREF="../../java/math/BigInteger.html">BigInteger</A> val)</PRE><DL><DD>Returns a BigInteger whose value is the greatest common divisor of <tt>abs(this)</tt> and <tt>abs(val)</tt>. Returns 0 if <tt>this==0 && val==0</tt>.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>val</CODE> - value with with the GCD is to be computed.<DT><B>Returns:</B><DD><tt>GCD(abs(this), abs(val))</tt></DL></DD></DL><HR><A NAME="abs()"><!-- --></A><H3>abs</H3><PRE>public <A HREF="../../java/math/BigInteger.html">BigInteger</A> <B>abs</B>()</PRE><DL><DD>Returns a BigInteger whose value is the absolute value of this BigInteger.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD><tt>abs(this)</tt></DL></DD></DL><HR><A NAME="negate()"><!-- --></A><H3>negate</H3><PRE>public <A HREF="../../java/math/BigInteger.html">BigInteger</A> <B>negate</B>()</PRE><DL><DD>Returns a BigInteger whose value is <tt>(-this)</tt>.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD><tt>-this</tt></DL></DD></DL><HR><A NAME="signum()"><!-- --></A><H3>signum</H3><PRE>public int <B>signum</B>()</PRE><DL><DD>Returns the signum function of this BigInteger.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>-1, 0 or 1 as the value of this BigInteger is negative, zero or positive.</DL></DD></DL><HR><A NAME="mod(java.math.BigInteger)"><!-- --></A><H3>mod</H3><PRE>public <A HREF="../../java/math/BigInteger.html">BigInteger</A> <B>mod</B>(<A HREF="../../java/math/BigInteger.html">BigInteger</A> m)</PRE><DL><DD>Returns a BigInteger whose value is <tt>(this mod m</tt>). This method differs from <tt>remainder</tt> in that it always returns a <i>positive</i> BigInteger.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>m</CODE> - the modulus.<DT><B>Returns:</B><DD><tt>this mod m</tt><DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/ArithmeticException.html">ArithmeticException</A></CODE> - <tt>m <= 0</tt><DT><B>See Also: </B><DD><A HREF="../../java/math/BigInteger.html#remainder(java.math.BigInteger)"><CODE>remainder(java.math.BigInteger)</CODE></A></DL></DD></DL><HR><A NAME="modPow(java.math.BigInteger, java.math.BigInteger)"><!-- --></A><H3>modPow</H3><PRE>public <A HREF="../../java/math/BigInteger.html">BigInteger</A> <B>modPow</B>(<A HREF="../../java/math/BigInteger.html">BigInteger</A> exponent, <A HREF="../../java/math/BigInteger.html">BigInteger</A> m)</PRE><DL><DD>Returns a BigInteger whose value is <tt>(this<sup>exponent</sup> mod m)</tt>. (Unlike <tt>pow</tt>, this method permits negative exponents.)<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>exponent</CODE> - the exponent.<DD><CODE>m</CODE> - the modulus.<DT><B>Returns:</B><DD><tt>this<sup>exponent</sup> mod m</tt><DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/ArithmeticException.html">ArithmeticException</A></CODE> - <tt>m <= 0</tt><DT><B>See Also: </B><DD><A HREF="../../java/math/BigInteger.html#modInverse(java.math.BigInteger)"><CODE>modInverse(java.math.BigInteger)</CODE></A></DL></DD></DL><HR><A NAME="modInverse(java.math.BigInteger)"><!-- --></A><H3>modInverse</H3><PRE>public <A HREF="../../java/math/BigInteger.html">BigInteger</A> <B>modInverse</B>(<A HREF="../../java/math/BigInteger.html">BigInteger</A> m)</PRE><DL><DD>Returns a BigInteger whose value is <tt>(this<sup>-1</sup> mod m)</tt>.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>m</CODE> - the modulus.<DT><B>Returns:</B><DD><tt>this<sup>-1</sup> mod m</tt>.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/ArithmeticException.html">ArithmeticException</A></CODE> - <tt> m <= 0</tt>, or this BigInteger has no multiplicative inverse mod m (that is, this BigInteger is not <i>relatively prime</i> to m).</DL></DD></DL><HR><A NAME="shiftLeft(int)"><!-- --></A><H3>shiftLeft</H3><PRE>public <A HREF="../../java/math/BigInteger.html">BigInteger</A> <B>shiftLeft</B>(int n)</PRE><DL><DD>Returns a BigInteger whose value is <tt>(this << n)</tt>. The shift distance, <tt>n</tt>, may be negative, in which case this method performs a right shift. (Computes <tt>floor(this * 2<sup>n</sup>)</tt>.)<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>n</CODE> - shift distance, in bits.<DT><B>Returns:</B><DD><tt>this << n</tt><DT><B>See Also: </B><DD><A HREF="../../java/math/BigInteger.html#shiftRight(int)"><CODE>shiftRight(int)</CODE></A></DL></DD></DL><HR><A NAME="shiftRight(int)"><!-- --></A><H3>shiftRight</H3><PRE>public <A HREF="../../java/math/BigInteger.html">BigInteger</A> <B>shiftRight</B>(int n)</PRE><DL><DD>Returns a BigInteger whose value is <tt>(this >> n)</tt>. Sign extension is performed. The shift distance, <tt>n</tt>, may be negative, in which case this method performs a left shift. (Computes <tt>floor(this / 2<sup>n</sup>)</tt>.)<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>n</CODE> - shift distance, in bits.<DT><B>Returns:</B><DD><tt>this >> n</tt><DT><B>See Also: </B><DD><A HREF="../../java/math/BigInteger.html#shiftLeft(int)"><CODE>shiftLeft(int)</CODE></A></DL></DD></DL><HR><A NAME="and(java.math.BigInteger)"><!-- --></A><H3>and</H3><PRE>public <A HREF="../../java/math/BigInteger.html">BigInteger</A> <B>and</B>(<A HREF="../../java/math/BigInteger.html">BigInteger</A> val)</PRE><DL><DD>Returns a BigInteger whose value is <tt>(this & val)</tt>. (This method returns a negative BigInteger if and only if this and val are both negative.)<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>val</CODE> - value to be AND'ed with this BigInteger.<DT><B>Returns:</B><DD><tt>this & val</tt></DL></DD></DL><HR><A NAME="or(java.math.BigInteger)"><!-- --></A><H3>or</H3><PRE>public <A HREF="../../java/math/BigInteger.html">BigInteger</A> <B>or</B>(<A HREF="../../java/math/BigInteger.html">BigInteger</A> val)</PRE><DL><DD>Returns a BigInteger whose value is <tt>(this | val)</tt>. (This method returns a negative BigInteger if and only if either this or val is negative.)<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>val</CODE> - value to be OR'ed with this BigInteger.<DT><B>Returns:</B><DD><tt>this | val</tt></DL></DD></DL><HR><A NAME="xor(java.math.BigInteger)"><!-- --></A><H3>xor</H3><PRE>public <A HREF="../../java/math/BigInteger.html">BigInteger</A> <B>xor</B>(<A HREF="../../java/math/BigInteger.html">BigInteger</A> val)</PRE><DL><DD>Returns a BigInteger whose value is <tt>(this ^ val)</tt>. (This method returns a negative BigInteger if and only if exactly one of this and val are negative.)<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>val</CODE> - value to be XOR'ed with this BigInteger.<DT><B>Returns:</B><DD><tt>this ^ val</tt></DL></DD></DL><HR><A NAME="not()"><!-- --></A><H3>not</H3><PRE>public <A HREF="../../java/math/BigInteger.html">BigInteger</A> <B>not</B>()</PRE><DL><DD>Returns a BigInteger whose value is <tt>(~this)</tt>. (This method returns a negative value if and only if this BigInteger is non-negative.)<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD><tt>~this</tt></DL></DD></DL><HR><A NAME="andNot(java.math.BigInteger)"><!-- --></A><H3>andNot</H3><PRE>public <A HREF="../../java/math/BigInteger.html">BigInteger</A> <B>andNot</B>(<A HREF="../../java/math/BigInteger.html">BigInteger</A> val)</PRE><DL><DD>Returns a BigInteger whose value is <tt>(this & ~val)</tt>. This method, which is equivalent to <tt>and(val.not())</tt>, is provided as a convenience for masking operations. (This method returns a negative BigInteger if and only if <tt>this</tt> is negative and <tt>val</tt> is positive.)<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>val</CODE> - value to be complemented and AND'ed with this BigInteger.<DT><B>Returns:</B><DD><tt>this & ~val</tt></DL></DD></DL><HR><A NAME="testBit(int)"><!-- --></A><H3>testBit</H3><PRE>public boolean <B>testBit</B>(int n)</PRE><DL><DD>Returns <tt>true</tt> if and only if the designated bit is set. (Computes <tt>((this & (1<<n)) != 0)</tt>.)<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>n</CODE> - index of bit to test.<DT><B>Returns:</B><DD><tt>true</tt> if and only if the designated bit is set.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/ArithmeticException.html">ArithmeticException</A></CODE> - <tt>n</tt> is negative.</DL></DD></DL><HR><A NAME="setBit(int)"><!-- --></A><H3>setBit</H3><PRE>public <A HREF="../../java/math/BigInteger.html">BigInteger</A> <B>setBit</B>(int n)</PRE><DL><DD>Returns a BigInteger whose value is equivalent to this BigInteger with the designated bit set. (Computes <tt>(this | (1<<n))</tt>.)<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>n</CODE> - index of bit to set.<DT><B>Returns:</B><DD><tt>this | (1<<n)</tt><DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/ArithmeticException.html">ArithmeticException</A></CODE> - <tt>n</tt> is negative.</DL></DD></DL><HR><A NAME="clearBit(int)"><!-- --></A><H3>clearBit</H3><PRE>public <A HREF="../../java/math/BigInteger.html">BigInteger</A> <B>clearBit</B>(int n)</PRE><DL>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -