Lines Matching defs:signum

101      * The signum of this BigInteger: -1 for negative, 0 for zero, or
103 * a signum of 0. This is necessary to ensures that there is exactly one
108 final int signum;
194 signum = -1;
197 signum = (mag.length == 0 ? 0 : 1);
213 signum = -1;
216 signum = (mag.length == 0 ? 0 : 1);
222 * BigInteger. The sign is represented as an integer signum value: -1 for
226 * result in a BigInteger value of 0, whether signum is -1, 0 or 1.
228 * @param signum signum of the number (-1 for negative, 0 for zero, 1
232 * @throws NumberFormatException {@code signum} is not one of the three
233 * legal values (-1, 0, and 1), or {@code signum} is 0 and
236 public BigInteger(int signum, byte[] magnitude) {
239 if (signum < -1 || signum > 1)
240 throw(new NumberFormatException("Invalid signum value"));
243 this.signum = 0;
245 if (signum == 0)
246 throw(new NumberFormatException("signum-magnitude mismatch"));
247 this.signum = signum;
257 private BigInteger(int signum, int[] magnitude) {
260 if (signum < -1 || signum > 1)
261 throw(new NumberFormatException("Invalid signum value"));
264 this.signum = 0;
266 if (signum == 0)
267 throw(new NumberFormatException("signum-magnitude mismatch"));
268 this.signum = signum;
319 signum = 0;
325 signum = sign;
378 signum = 0;
384 signum = sign;
538 signum = 1;
657 if (this.signum < 0)
661 if ((this.signum == 0) || this.equals(ONE))
923 BigInteger(int[] magnitude, int signum) {
924 this.signum = (magnitude.length==0 ? 0 : signum);
932 private BigInteger(byte[] magnitude, int signum) {
933 this.signum = (magnitude.length==0 ? 0 : signum);
966 signum = -1;
968 signum = 1;
1043 if (val.signum == 0)
1045 if (signum == 0)
1047 if (val.signum == signum)
1048 return new BigInteger(add(mag, val.mag), signum);
1057 return new BigInteger(resultMag, cmp == signum ? 1 : -1);
1111 if (val.signum == 0)
1113 if (signum == 0)
1115 if (val.signum != signum)
1116 return new BigInteger(add(mag, val.mag), signum);
1124 return new BigInteger(resultMag, cmp == signum ? 1 : -1);
1166 if (val.signum == 0 || signum == 0)
1172 return new BigInteger(result, signum == val.signum ? 1 : -1);
1180 if (v == 0 || signum == 0)
1184 int rsign = (v > 0 ? signum : -signum);
1257 if (signum == 0)
1343 return q.toBigInteger(this.signum == val.signum ? 1 : -1);
1363 result[0] = q.toBigInteger(this.signum == val.signum ? 1 : -1);
1364 result[1] = r.toBigInteger(this.signum);
1381 return a.divide(b, q).toBigInteger(this.signum);
1396 if (signum==0)
1400 int newSign = (signum<0 && (exponent&1)==1 ? -1 : 1);
1427 if (val.signum == 0)
1429 else if (this.signum == 0)
1519 return (signum >= 0 ? this : this.negate());
1528 return new BigInteger(this.mag, -this.signum);
1532 * Returns the signum function of this BigInteger.
1537 public int signum() {
1538 return this.signum;
1554 if (m.signum <= 0)
1558 return (result.signum >= 0 ? result : result.add(m));
1575 if (m.signum <= 0)
1579 if (exponent.signum == 0)
1585 if (this.equals(ZERO) && exponent.signum >= 0)
1592 if ((invertResult = (exponent.signum < 0)))
1595 BigInteger base = (this.signum < 0 || this.compareTo(m) >= 0
1614 BigInteger base2 = (this.signum < 0 || this.compareTo(m1) >= 0
1705 if (signum==0)
2025 if (m.signum != 1)
2033 if (signum < 0 || (this.compareMagnitude(m) >= 0))
2061 if (signum == 0)
2098 return new BigInteger(newMag, signum);
2131 return (signum >= 0 ? ZERO : negConst[1]);
2154 if (signum < 0) {
2166 return new BigInteger(newMag, signum);
2368 if (signum == 0) {
2405 if (signum < 0) {
2436 if (signum < 0) {
2493 if (signum == val.signum) {
2494 switch (signum) {
2503 return signum > val.signum ? 1 : -1;
2548 if (xInt.signum != signum)
2600 return hashCode * signum;
2621 if (signum == 0)
2633 while (tmp.signum != 0) {
2640 BigInteger q2 = q.toBigInteger(tmp.signum * d.signum);
2641 BigInteger r2 = r.toBigInteger(tmp.signum * d.signum);
2649 if (signum<0)
2999 return signum < 0 ? 1 : 0;
3004 return signum < 0 ? -1 : 0;
3021 return (signum >= 0 ? magInt :
3052 * @serialField signum int
3053 * signum of this BigInteger.
3065 new ObjectStreamField("signum", Integer.TYPE),
3099 int sign = fields.get("signum", -2);
3102 // Validate signum
3104 String message = "BigInteger: Invalid signum value";
3105 if (fields.defaulted("signum"))
3110 String message = "BigInteger: signum-magnitude mismatch";
3131 (BigInteger.class.getDeclaredField("signum"));
3150 fields.put("signum", signum);