/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/math/ |
D | BigIntegerConstructorsTest.java | 59 assertEquals("incorrect sign", 1, aNumber.signum()); in testConstructorBytesPositive1() 75 assertEquals("incorrect sign", 1, aNumber.signum()); in testConstructorBytesPositive2() 91 assertEquals("incorrect sign", 1, aNumber.signum()); in testConstructorBytesPositive3() 107 assertEquals("incorrect sign", 1, aNumber.signum()); in testConstructorBytesPositive() 123 assertEquals("incorrect sign", -1, aNumber.signum()); in testConstructorBytesNegative1() 139 assertEquals("incorrect sign", -1, aNumber.signum()); in testConstructorBytesNegative2() 155 assertEquals("incorrect sign", -1, aNumber.signum()); in testConstructorBytesNegative3() 171 assertEquals("incorrect sign", -1, aNumber.signum()); in testConstructorBytesNegative4() 186 assertEquals("incorrect sign", 0, aNumber.signum()); in testConstructorBytesZero() 233 assertEquals("incorrect sign", 1, aNumber.signum()); in testConstructorSignBytesPositive1() [all …]
|
D | BigIntegerOperateBitsTest.java | 154 assertEquals("incorrect sign", 0, result.signum()); in testClearBitZero() 172 assertEquals("incorrect sign", 0, result.signum()); in testClearBitZeroOutside1() 190 assertEquals("incorrect sign", -1, result.signum()); in testClearBitNegativeInside1() 208 assertEquals("incorrect sign", -1, result.signum()); in testClearBitNegativeInside2() 265 assertEquals("incorrect sign", -1, result.signum()); in testClearBitNegativeOutside1() 283 assertEquals("incorrect sign", -1, result.signum()); in testClearBitNegativeOutside2() 301 assertEquals("incorrect sign", 1, result.signum()); in testClearBitPositiveInside1() 319 assertEquals("incorrect sign", 1, result.signum()); in testClearBitPositiveInside2() 337 assertEquals("incorrect sign", 1, result.signum()); in testClearBitPositiveInside3() 355 assertEquals("incorrect sign", 1, result.signum()); in testClearBitPositiveInside4() [all …]
|
D | BigIntegerAddTest.java | 48 assertEquals("incorrect sign", 1, result.signum()); in testCase1() 68 assertEquals("incorrect sign", -1, result.signum()); in testCase2() 90 assertEquals("incorrect sign", 1, result.signum()); in testCase3() 112 assertEquals("incorrect sign", -1, result.signum()); in testCase4() 134 assertEquals("incorrect sign", -1, result.signum()); in testCase5() 156 assertEquals("incorrect sign", 1, result.signum()); in testCase6() 177 assertEquals("incorrect sign", 1, result.signum()); in testCase7() 196 assertEquals("incorrect sign", 1, result.signum()); in testCase8() 217 assertEquals("incorrect sign", -1, result.signum()); in testCase9() 238 assertEquals("incorrect sign", -1, result.signum()); in testCase10() [all …]
|
D | BigIntegerAndTest.java | 48 assertEquals("incorrect sign", 0, result.signum()); in testZeroPos() 68 assertEquals("incorrect sign", 0, result.signum()); in testZeroNeg() 88 assertEquals("incorrect sign", 0, result.signum()); in testPosZero() 108 assertEquals("incorrect sign", 0, result.signum()); in testNegPos() 128 assertEquals("incorrect sign", 0, result.signum()); in testZeroZero() 139 assertEquals("incorrect sign", 0, result.signum()); in testZeroOne() 150 assertEquals("incorrect sign", 1, result.signum()); in testOneOne() 170 assertEquals("incorrect sign", 1, result.signum()); in testPosPosSameLength() 190 assertEquals("incorrect sign", 1, result.signum()); in testPosPosFirstLonger() 210 assertEquals("incorrect sign", 1, result.signum()); in testPosPosFirstShorter() [all …]
|
D | BigIntegerSubtractTest.java | 49 assertEquals(1, result.signum()); in testCase1() 70 assertEquals(-1, result.signum()); in testCase2() 92 assertEquals(1, result.signum()); in testCase3() 114 assertEquals(1, result.signum()); in testCase4() 135 assertEquals(-1, result.signum()); in testCase5() 156 assertEquals(1, result.signum()); in testCase6() 178 assertEquals(-1, result.signum()); in testCase7() 200 assertEquals(-1, result.signum()); in testCase8() 221 assertEquals(1, result.signum()); in testCase9() 242 assertEquals(-1, result.signum()); in testCase10() [all …]
|
D | BigIntegerDivideTest.java | 80 assertEquals("incorrect sign", 1, result.signum()); in testCase3() 100 assertEquals("incorrect sign", -1, result.signum()); in testCase4() 121 assertEquals("incorrect sign", 0, result.signum()); in testCase5() 142 assertEquals("incorrect sign", 0, result.signum()); in testCase6() 162 assertEquals("incorrect sign", 1, result.signum()); in testCase7() 182 assertEquals("incorrect sign", -1, result.signum()); in testCase8() 202 assertEquals("incorrect sign", -1, result.signum()); in testCase9() 222 assertEquals("incorrect sign", 1, result.signum()); in testCase10() 242 assertEquals("incorrect sign", 0, result.signum()); in testCase11() 260 assertEquals("incorrect sign", 0, result.signum()); in testCase12() [all …]
|
D | BigIntegerMultiplyTest.java | 48 assertEquals("incorrect sign", 1, result.signum()); in testCase1() 69 assertEquals("incorrect sign", -1, result.signum()); in testCase2() 91 assertEquals("incorrect sign", 1, result.signum()); in testCase3() 113 assertEquals("incorrect sign", 1, result.signum()); in testCase4() 136 assertEquals("incorrect sign", -1, result.signum()); in testCase5() 159 assertEquals("incorrect sign", -1, result.signum()); in testCase6() 179 assertEquals("incorrect sign", 0, result.signum()); in testCase7() 197 assertEquals("incorrect sign", 0, result.signum()); in testCase8() 215 assertEquals("incorrect sign", 1, result.signum()); in testCase9() 233 assertEquals("incorrect sign", -1, result.signum()); in testCase10() [all …]
|
D | BigIntegerOrTest.java | 48 assertEquals("incorrect sign", 1, result.signum()); in testZeroPos() 68 assertEquals("incorrect sign", -1, result.signum()); in testZeroNeg() 88 assertEquals("incorrect sign", 1, result.signum()); in testPosZero() 108 assertEquals("incorrect sign", -1, result.signum()); in testNegPos() 128 assertEquals("incorrect sign", 0, result.signum()); in testZeroZero() 148 assertEquals("incorrect sign", 1, result.signum()); in testZeroOne() 168 assertEquals("incorrect sign", 1, result.signum()); in testOneOne() 188 assertEquals("incorrect sign", 1, result.signum()); in testPosPosSameLength() 208 assertEquals("incorrect sign", 1, result.signum()); in testPosPosFirstLonger() 228 assertEquals("incorrect sign", 1, result.signum()); in testPosPosFirstShorter() [all …]
|
D | BigIntegerNotTest.java | 48 assertEquals("incorrect sign", 1, result.signum()); in testAndNotPosPosFirstLonger() 68 assertEquals("incorrect sign", 1, result.signum()); in testAndNotPosPosFirstShorter() 88 assertEquals("incorrect sign", 1, result.signum()); in testAndNotNegNegFirstLonger() 108 assertEquals("incorrect sign", -1, result.signum()); in testNegPosFirstLonger() 123 assertEquals("incorrect sign", -1, result.signum()); in testNotZero() 138 assertEquals("incorrect sign", -1, result.signum()); in testNotOne() 155 assertEquals("incorrect sign", -1, result.signum()); in testNotPos() 172 assertEquals("incorrect sign", 1, result.signum()); in testNotNeg() 190 assertEquals("incorrect sign", -1, result.signum()); in testNotSpecialCase()
|
D | BigIntegerCompareTest.java | 45 assertEquals("incorrect sign", 1, result.signum()); in testAbsPositive() 62 assertEquals("incorrect sign", 1, result.signum()); in testAbsNegative() 311 assertTrue("incorrect sign", result.signum() == 1); in testMaxGreater() 332 assertTrue("incorrect sign", result.signum() == 1); in testMaxLess() 353 assertEquals("incorrect sign", 1, result.signum()); in testMaxEqual() 372 assertTrue("incorrect sign", result.signum() == 0); in testMaxNegZero() 393 assertEquals("incorrect sign", 1, result.signum()); in testMinGreater() 414 assertEquals("incorrect sign", 1, result.signum()); in testMinLess() 435 assertTrue("incorrect sign", result.signum() == 1); in testMinEqual() 454 assertTrue("incorrect sign", result.signum() == 0); in testMinPosZero() [all …]
|
D | BigIntegerModPowTest.java | 78 assertEquals("incorrect sign", 1, result.signum()); in testModPowPosExp() 101 assertEquals("incorrect sign", 1, result.signum()); in testModPowNegExp() 178 assertEquals("incorrect sign", 1, result.signum()); in testmodInversePos1() 198 assertEquals("incorrect sign", 1, result.signum()); in testmodInversePos2() 218 assertEquals("incorrect sign", 1, result.signum()); in testmodInverseNeg1() 236 assertEquals("incorrect sign", 1, result.signum()); in testmodInverseNeg2() 256 assertEquals("incorrect sign", 1, result.signum()); in testGcdSecondZero() 276 assertEquals("incorrect sign", 1, result.signum()); in testGcdFirstZero() 294 assertEquals("incorrect sign", 1, result.signum()); in testGcdFirstZERO() 309 assertEquals("incorrect sign", 0, result.signum()); in testGcdBothZeros() [all …]
|
D | BigIntegerTest.java | 329 assertTrue("Wrong positive signum", two.signum() == 1); in test_signum() 330 assertTrue("Wrong zero signum", zero.signum() == 0); in test_signum() 331 assertTrue("Wrong neg zero signum", zero.negate().signum() == 0); in test_signum() 332 assertTrue("Wrong neg signum", two.negate().signum() == -1); in test_signum() 446 assertTrue("a non-neg", a.signum() >= 0); in test_shiftRightI() 452 assertTrue("c non-neg", c.signum() >= 0); in test_shiftRightI() 458 assertTrue("e negative", e.signum() == -1); in test_shiftRightI() 495 assertTrue("a non-neg", a.signum() >= 0); in test_shiftLeftI() 502 assertTrue("c negative", c.signum() == -1); in test_shiftLeftI() 908 .signum() != 0 in testDiv() [all …]
|
D | BigIntegerConvertTest.java | 669 assertEquals("incorrect sign", 1, aNumber.signum()); in testValueOfIntegerMax() 684 assertEquals("incorrect sign", -1, aNumber.signum()); in testValueOfIntegerMin() 699 assertEquals("incorrect sign", 1, aNumber.signum()); in testValueOfLongMax() 714 assertEquals("incorrect sign", -1, aNumber.signum()); in testValueOfLongMin() 729 assertEquals("incorrect sign", 1, aNumber.signum()); in testValueOfLongPositive1() 745 assertEquals("incorrect sign", 1, aNumber.signum()); in testValueOfLongPositive2() 760 assertEquals("incorrect sign", -1, aNumber.signum()); in testValueOfLongNegative1() 776 assertEquals("incorrect sign", -1, aNumber.signum()); in testValueOfLongNegative2() 790 assertEquals("incorrect sign", 0, aNumber.signum()); in testValueOfLongZero()
|
/libcore/ojluni/src/main/java/java/math/ |
D | BigInteger.java | 140 final int signum; field in BigInteger 317 signum = -1; in BigInteger() 320 signum = (mag.length == 0 ? 0 : 1); in BigInteger() 356 signum = -1; in BigInteger() 359 signum = (mag.length == 0 ? 0 : 1); in BigInteger() 395 public BigInteger(int signum, byte[] magnitude, int off, int len) { in BigInteger() argument 396 if (signum < -1 || signum > 1) { in BigInteger() 405 this.signum = 0; in BigInteger() 407 if (signum == 0) in BigInteger() 409 this.signum = signum; in BigInteger() [all …]
|
D | BigDecimal.java | 1425 boolean lhsIsZero = lhs.signum() == 0; in add() 1426 boolean augendIsZero = augend.signum() == 0; in add() 1517 …small = BigDecimal.valueOf(small.signum(), this.checkScale(Math.max(big.scale, estResultUlpScale) … in preAlign() 1761 if (divisor.signum() == 0) { // x/0 in divide() 1762 if (this.signum() == 0) // 0/0 in divide() 1770 if (this.signum() == 0) // 0/y in divide() 1838 if (divisor.signum() == 0) { // x/0 in divide() 1839 if (dividend.signum() == 0) // 0/0 in divide() 1843 if (dividend.signum() == 0) // 0/y in divide() 1881 if (this.signum() == 0 && divisor.signum() != 0) in divideToIntegralValue() [all …]
|
/libcore/luni/src/test/java/libcore/java/lang/ |
D | OldAndroidStrictMathTest.java | 458 assertTrue(Double.isNaN(StrictMath.signum(Double.NaN))); in testSignumD() 460 .doubleToLongBits(StrictMath.signum(0.0))); in testSignumD() 462 .doubleToLongBits(StrictMath.signum(+0.0))); in testSignumD() 464 .doubleToLongBits(StrictMath.signum(-0.0))); in testSignumD() 466 assertEquals(1.0, StrictMath.signum(253681.2187962), 0D); in testSignumD() 467 assertEquals(-1.0, StrictMath.signum(-125874693.56), 0D); in testSignumD() 468 assertEquals(1.0, StrictMath.signum(1.2587E-308), 0D); in testSignumD() 469 assertEquals(-1.0, StrictMath.signum(-1.2587E-308), 0D); in testSignumD() 471 assertEquals(1.0, StrictMath.signum(Double.MAX_VALUE), 0D); in testSignumD() 472 assertEquals(1.0, StrictMath.signum(Double.MIN_VALUE), 0D); in testSignumD() [all …]
|
D | OldAndroidMathTest.java | 481 assertTrue(Double.isNaN(Math.signum(Double.NaN))); in testSignumD() 482 assertTrue(Double.isNaN(Math.signum(Double.NaN))); in testSignumD() 484 .signum(0.0))); in testSignumD() 486 .doubleToLongBits(Math.signum(+0.0))); in testSignumD() 488 .doubleToLongBits(Math.signum(-0.0))); in testSignumD() 490 assertEquals(1.0, Math.signum(253681.2187962), 0D); in testSignumD() 491 assertEquals(-1.0, Math.signum(-125874693.56), 0D); in testSignumD() 492 assertEquals(1.0, Math.signum(1.2587E-308), 0D); in testSignumD() 493 assertEquals(-1.0, Math.signum(-1.2587E-308), 0D); in testSignumD() 495 assertEquals(1.0, Math.signum(Double.MAX_VALUE), 0D); in testSignumD() [all …]
|
D | LongTest.java | 54 assertEquals(0, Long.signum(0)); 55 assertEquals(1, Long.signum(1)); 56 assertEquals(-1, Long.signum(-1)); 57 assertEquals(1, Long.signum(Long.MAX_VALUE)); 58 assertEquals(-1, Long.signum(Long.MIN_VALUE));
|
/libcore/luni/src/test/java/libcore/javax/xml/datatype/ |
D | XMLGregorianCalendarTest.java | 290 if (year != rhs.getYear()) return Integer.signum(year - rhs.getYear()); in compare() 291 if (month != rhs.getMonth()) return Integer.signum(month - rhs.getMonth()); in compare() 292 if (day != rhs.getDay()) return Integer.signum(day - rhs.getDay()); in compare() 293 if (hour != rhs.getHour()) return Integer.signum(hour - rhs.getHour()); in compare() 294 if (minute != rhs.getMinute()) return Integer.signum(minute - rhs.getMinute()); in compare() 295 if (second != rhs.getSecond()) return Integer.signum(second - rhs.getSecond()); in compare() 298 return Integer.signum(getMillisecond() - rhs.getMillisecond()); in compare()
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/ |
D | StrictMathTest.java | 1302 assertTrue(Double.isNaN(StrictMath.signum(Double.NaN))); in test_signum_D() 1304 .doubleToLongBits(StrictMath.signum(0.0))); in test_signum_D() 1306 .doubleToLongBits(StrictMath.signum(+0.0))); in test_signum_D() 1308 .doubleToLongBits(StrictMath.signum(-0.0))); in test_signum_D() 1310 assertEquals(1.0, StrictMath.signum(253681.2187962), 0D); in test_signum_D() 1311 assertEquals(-1.0, StrictMath.signum(-125874693.56), 0D); in test_signum_D() 1312 assertEquals(1.0, StrictMath.signum(1.2587E-308), 0D); in test_signum_D() 1313 assertEquals(-1.0, StrictMath.signum(-1.2587E-308), 0D); in test_signum_D() 1315 assertEquals(1.0, StrictMath.signum(Double.MAX_VALUE), 0D); in test_signum_D() 1316 assertEquals(1.0, StrictMath.signum(Double.MIN_VALUE), 0D); in test_signum_D() [all …]
|
D | MathTest.java | 1732 assertTrue(Double.isNaN(Math.signum(Double.NaN))); in test_signum_D() 1733 assertTrue(Double.isNaN(Math.signum(Double.NaN))); in test_signum_D() 1735 .signum(0.0))); in test_signum_D() 1737 .doubleToLongBits(Math.signum(+0.0))); in test_signum_D() 1739 .doubleToLongBits(Math.signum(-0.0))); in test_signum_D() 1741 assertEquals(1.0, Math.signum(253681.2187962), 0D); in test_signum_D() 1742 assertEquals(-1.0, Math.signum(-125874693.56), 0D); in test_signum_D() 1743 assertEquals(1.0, Math.signum(1.2587E-308), 0D); in test_signum_D() 1744 assertEquals(-1.0, Math.signum(-1.2587E-308), 0D); in test_signum_D() 1746 assertEquals(1.0, Math.signum(Double.MAX_VALUE), 0D); in test_signum_D() [all …]
|
/libcore/luni/src/test/resources/ |
D | math_java_only.csv | 183 signum,-0x1.0p0,-0x1.8ec3beb2d4185p1023 184 signum,-0x1.0p0,-0x1.a49ea827e7d05p1023 185 signum,-0x1.0p0,-0x1.47afe754a89fep1021 186 signum,-0x1.0p0,-0x1.ea33b08c7fbfbp1022 187 signum,0x1.0p0,0x1.40c8f2c416881p1023 188 signum,-0x1.0p0,-0x1.d2762c5e7c22bp1022 189 signum,0x1.0p0,0x1.0c0c8b67b7daep1021 190 signum,-0x1.0p0,-0x1.800e50b80ea85p1023 191 signum,0x1.0p0,0x1.ccf6eeb86909cp1020 192 signum,-0x1.0p0,-0x1.6d6d5ccb7231fp1022 [all …]
|
/libcore/ojluni/src/test/java/math/BigInteger/ |
D | BigIntegerTest.java | 168 for (int signum = -1; signum <= 1; signum++) { in constructor() 169 BigInteger bi = new BigInteger(signum, magZeroLength); in constructor() 171 "A: Zero length BigInteger != 0 for signum " + signum); in constructor() local 174 for (int signum = -1; signum <= 1; signum++) { in constructor() 175 BigInteger bi = new BigInteger(signum, magZeroLength, 0, 0); in constructor() 177 "B: Zero length BigInteger != 0 for signum " + signum); in constructor() local 182 for (int signum = -1; signum <= 1; signum++) { in constructor() 183 BigInteger bi = new BigInteger(signum, magNonZeroLength, 0, 0); in constructor() 185 "C: Zero length BigInteger != 0 for signum " + signum); in constructor() local 558 if (x.signum() < 0) { in bitOps() [all …]
|
/libcore/ojluni/src/main/java/sun/misc/ |
D | FpUtils.java | 905 public static double signum(double d) { in signum() method in FpUtils 906 return Math.signum(d); in signum() 928 public static float signum(float f) { in signum() method in FpUtils 929 return Math.signum(f); in signum()
|
/libcore/ojluni/src/test/java/math/BigDecimal/ |
D | SquareRootTests.java | 427 int signum = bd.signum(); 428 if (signum == 1) { 599 switch (signum) { 622 if (result.signum() == 0) { 635 if (result.signum() != 1 || 636 input.signum() != 1) { 676 errUp.signum() == 1 && 677 errDown.signum() == 1 :
|