Home
last modified time | relevance | path

Searched refs:abs (Results 1 – 25 of 32) sorted by relevance

12

/libcore/luni/src/test/java/libcore/java/math/
DOldBigDecimalCompareTest.java36 …assertEquals("incorrect value", "1.238096483923847545735673567457357E+53", aNumber.abs(mc).toStrin… in testAbsMathContextNeg()
39 …assertEquals("incorrect value", "1.238096483923847545735673567457356E+53", aNumber.abs(mc).toStrin… in testAbsMathContextNeg()
42 …assertEquals("incorrect value", "1.238096483923847545735673567457356E+53", aNumber.abs(mc).toStrin… in testAbsMathContextNeg()
45 …assertEquals("incorrect value", "1.238096483923847545735673567457357E+53", aNumber.abs(mc).toStrin… in testAbsMathContextNeg()
49 aNumber.abs(mc); in testAbsMathContextNeg()
DBigDecimalTest.java96 assertEquals("1.20", a.abs(new MathContext(3,RoundingMode.HALF_UP)).toPlainString()); in test54580()
/libcore/luni/src/test/java/libcore/java/lang/
DIntrinsicTest.java56 Math.abs(1); in testMath_abs()
58 Math.abs(1L); in testMath_abs()
60 Math.abs(1.0f); in testMath_abs()
62 Math.abs(1.0); in testMath_abs()
67 StrictMath.abs(1); in testStrictMath_abs()
69 StrictMath.abs(1L); in testStrictMath_abs()
71 StrictMath.abs(1.0f); in testStrictMath_abs()
73 StrictMath.abs(1.0); in testStrictMath_abs()
DOldAndroidStrictMathTest.java37 (StrictMath.abs(-1908.8976) == 1908.8976)); in testAbsD()
39 (StrictMath.abs(1908.8976) == 1908.8976)); in testAbsD()
45 (StrictMath.abs(-1908.8976f) == 1908.8976f)); in testAbsF()
47 (StrictMath.abs(1908.8976f) == 1908.8976f)); in testAbsF()
53 (StrictMath.abs(-1908897) == 1908897)); in testAbsI()
55 (StrictMath.abs(1908897) == 1908897)); in testAbsI()
61 .abs(-19088976000089L) == 19088976000089L)); in testAbsJ()
63 (StrictMath.abs(19088976000089L) == 19088976000089L)); in testAbsJ()
181 .abs(StrictMath.exp(4D) - StrictMath.E * StrictMath.E in testExpD()
184 .log(StrictMath.abs(StrictMath.exp(5.5D)) - 5.5D) < 10.0D); in testExpD()
[all …]
DOldAndroidMathTest.java54 (Math.abs(-1908.8976) == 1908.8976)); in testAbsD()
56 (Math.abs(1908.8976) == 1908.8976)); in testAbsD()
62 (Math.abs(-1908.8976f) == 1908.8976f)); in testAbsF()
64 (Math.abs(1908.8976f) == 1908.8976f)); in testAbsF()
69 assertTrue("Incorrect int abs value", (Math.abs(-1908897) == 1908897)); in testAbsI()
70 assertTrue("Incorrect int abs value", (Math.abs(1908897) == 1908897)); in testAbsI()
76 (Math.abs(-19088976000089L) == 19088976000089L)); in testAbsJ()
78 (Math.abs(19088976000089L) == 19088976000089L)); in testAbsJ()
187 assertTrue("Incorrect answer returned for simple power", Math.abs(Math in testExpD()
191 .abs(Math.exp(5.5D)) - 5.5D) < 10.0D); in testExpD()
[all …]
DThreadTest.java68 long offBy = Math.abs(elapsed - millis); in testThreadSleep()
/libcore/luni/src/main/java/java/lang/
DStrictMath.java66 public static double abs(double d) { in abs() method in StrictMath
67 return Math.abs(d); in abs()
81 public static float abs(float f) { in abs() method in StrictMath
82 return Math.abs(f); in abs()
91 public static int abs(int i) { in abs() method in StrictMath
92 return Math.abs(i); in abs()
101 public static long abs(long l) { in abs() method in StrictMath
102 return Math.abs(l); in abs()
893 d = Math.abs(d); in ulp()
1030 if (Math.abs(d) < Double.MIN_NORMAL) { in scalb()
[all …]
DMath.java57 public static double abs(double d) { in abs() method in Math
72 public static float abs(float f) { in abs() method in Math
82 public static int abs(int i) { in abs() method in Math
90 public static long abs(long l) { in abs() method in Math
953 d = abs(d); in ulp()
988 f = Math.abs(f); in ulp()
1177 if (Math.abs(d) < Double.MIN_NORMAL) { in scalb()
1185 if (Math.abs(d) >= Double.MIN_NORMAL) { in scalb()
1228 if (Math.abs(d) < Float.MIN_NORMAL) { in scalb()
1236 if (Math.abs(d) >= Float.MIN_NORMAL) { in scalb()
/libcore/luni/src/test/resources/
Dmath_important_numbers.csv2 abs,0x1.5bf0a8b145769p1,0x1.5bf0a8b145769p1,2.718281828459045
3 abs,0x1.5bf0a8b145769p1,-0x1.5bf0a8b145769p1,-2.718281828459045
4 abs,0x0.0p0,0x0.0p0,0.0
5 abs,0x0.0p0,-0x0.0p0,-0.0
6 abs,0x1.0p0,0x1.0p0,1.0
7 abs,0x1.0p0,-0x1.0p0,-1.0
8 abs,0x1.0p-1,-0x1.0p-1,-0.5
9 abs,0x1.0p-1,0x1.0p-1,0.5
10 abs,0x1.921fb54442d18p2,-0x1.921fb54442d18p2,-6.283185307179586
11 abs,0x1.815e630c155e1p2,-0x1.815e630c155e1p2,-6.021385919380436
[all …]
Dmath_java_only.csv1133 abs,0x1.93d505df96a7bp1,-0x1.93d505df96a7bp1
1134 abs,0x1.772aabf17e9fap1,-0x1.772aabf17e9fap1
1135 abs,0x1.37482866cf6fbp0,0x1.37482866cf6fbp0
1136 abs,0x1.2f2d86b7d412bp0,-0x1.2f2d86b7d412bp0
1137 abs,0x1.1472bc84f162dp1,-0x1.1472bc84f162dp1
1138 abs,0x1.6f1aef4f2128fp-1,0x1.6f1aef4f2128fp-1
1139 abs,0x1.30f9423f14eeap0,-0x1.30f9423f14eeap0
1140 abs,0x1.a1c4694bb59efp-3,-0x1.a1c4694bb59efp-3
1141 abs,0x1.1103fecbf63fp0,-0x1.1103fecbf63fp0
1142 abs,0x1.2790898fcdf8ap1,-0x1.2790898fcdf8ap1
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/math/
DBigIntegerTest.java344 .abs().equals(aZillion.abs())); in test_abs()
345 assertTrue("Invalid number returned for zero neg", zero.negate().abs() in test_abs()
347 assertTrue("Invalid number returned for zero", zero.abs().equals(zero)); in test_abs()
348 assertTrue("Invalid number returned for two", two.negate().abs() in test_abs()
921 assertTrue("remainder out of range", r.abs().compareTo(i2.abs()) < 0); in testDiv()
922 assertTrue("quotient too small", q.abs().add(one).multiply(i2.abs()) in testDiv()
923 .compareTo(i1.abs()) > 0); in testDiv()
924 assertTrue("quotient too large", q.abs().multiply(i2.abs()).compareTo( in testDiv()
925 i1.abs()) <= 0); in testDiv()
932 assertTrue("mod out of range", mod.abs().compareTo(i2.abs()) < 0); in testDiv()
DMathContextTest.java73 BigDecimal res = aNumber.abs(mcInt6); in test_MathContextConstruction()
DBigDecimalCompareTest.java43 assertEquals("incorrect value", result, aNumber.abs().toString()); in testAbsNeg()
53 assertEquals("incorrect value", result, aNumber.abs().toString()); in testAbsPos()
67 BigDecimal res = aNumber.abs(mc); in testAbsMathContextNeg()
83 BigDecimal res = aNumber.abs(mc); in testAbsMathContextPos()
DBigIntegerCompareTest.java39 BigInteger result = aNumber.abs(); in testAbsPositive()
56 BigInteger result = aNumber.abs(); in testAbsNegative()
DBigDecimalTest.java172 BigDecimal bigabs = big.abs(); in test_abs()
176 bigabs = big.abs(); in test_abs()
930 BigDecimal res = aNumber.abs(mcInt); in testMathContextConstruction()
/libcore/luni/src/main/java/java/math/
DBigDecimal.java1088 compRem = longCompareTo(Math.abs(rem) * 2,Math.abs(divisor)); in divideBigIntegers()
1095 compRem = remainder.abs().shiftLeftOneBit().compareTo(scaledDivisor.abs()); in divideBigIntegers()
1117 compRem = longCompareTo(Math.abs(remainder) * 2,Math.abs(scaledDivisor)); in dividePrimitiveLongs()
1236 if (!q.abs().equals(BigInteger.ONE)) { in divide()
1456 compRemDiv = Math.abs(quotAndRem[1].signum()); in divideToIntegralValue()
1637 int m = Math.abs(n); in pow()
1680 public BigDecimal abs() { in abs() method in BigDecimal
1689 public BigDecimal abs(MathContext mc) { in abs() method in BigDecimal
1808 int index = Arrays.binarySearch(MathUtils.LONG_POWERS_OF_TEN, Math.abs(value)); in decimalDigitsInLong()
2317 StringBuilder result = new StringBuilder(intStr.length() + 1 + Math.abs(scale)); in toPlainString()
[all …]
DConversion.java76 int resLengthInChars = (int) (val.abs().bitLength() / bitsForRadixDigit + ((sign < 0) ? 1 in bigInteger2String()
430 int bitLen = val.abs().bitLength(); in bigInteger2Double()
434 long lVal = val.abs().shiftRight(delta).longValue(); in bigInteger2Double()
/libcore/benchmarks/src/benchmarks/regression/
DStrictMathBenchmark.java35 StrictMath.abs(d); in timeAbsD()
41 StrictMath.abs(f); in timeAbsF()
47 StrictMath.abs(i); in timeAbsI()
53 StrictMath.abs(l); in timeAbsL()
DMathBenchmark.java41 result = Math.abs(d); in timeAbsD()
49 result = Math.abs(f); in timeAbsF()
57 result = Math.abs(i); in timeAbsI()
65 result = Math.abs(l); in timeAbsL()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/
DStrictMathTest.java48 (StrictMath.abs(-1908.8976) == 1908.8976)); in test_absD()
50 (StrictMath.abs(1908.8976) == 1908.8976)); in test_absD()
59 (StrictMath.abs(-1908.8976f) == 1908.8976f)); in test_absF()
61 (StrictMath.abs(1908.8976f) == 1908.8976f)); in test_absF()
70 (StrictMath.abs(-1908897) == 1908897)); in test_absI()
72 (StrictMath.abs(1908897) == 1908897)); in test_absI()
81 .abs(-19088976000089L) == 19088976000089L)); in test_absJ()
83 (StrictMath.abs(19088976000089L) == 19088976000089L)); in test_absJ()
187 .abs(magnitude)); in test_copySign_DD()
189 .abs(magnitude)); in test_copySign_DD()
[all …]
DMathTest.java38 (Math.abs(-1908.8976) == 1908.8976)); in test_absD()
40 (Math.abs(1908.8976) == 1908.8976)); in test_absD()
49 (Math.abs(-1908.8976f) == 1908.8976f)); in test_absF()
51 (Math.abs(1908.8976f) == 1908.8976f)); in test_absF()
59 assertTrue("Incorrect int abs value", (Math.abs(-1908897) == 1908897)); in test_absI()
60 assertTrue("Incorrect int abs value", (Math.abs(1908897) == 1908897)); in test_absI()
69 (Math.abs(-19088976000089L) == 19088976000089L)); in test_absJ()
71 (Math.abs(19088976000089L) == 19088976000089L)); in test_absJ()
171 .abs(magnitude)); in test_copySign_DD()
173 .abs(magnitude)); in test_copySign_DD()
[all …]
DDoubleTest.java314 ….abs(new Double(999999999999999.9999999999999d).floatValue() - 999999999999999.9999999999999f) < 1… in test_floatValue()
1249 assertTrue("Incorrect double returned", Math.abs(Double.valueOf("999999999999.999") in test_valueOfLjava_lang_String()
/libcore/luni/src/test/java/libcore/java/net/
DOldAndroidDatagramTest.java180 if (Math.abs(delay - timeout) > 1000) { in testDatagramSocketSetSOTimeout()
/libcore/jsr166-tests/src/test/java/jsr166/
DThreadLocalRandomTest.java217 …for (long bound = least + 2; bound > least && bound < MAX_LONG_BOUND; bound += Math.abs(bound * 79…
/libcore/luni/src/test/java/libcore/javax/net/ssl/
DSSLSessionTest.java101 Math.abs(s.server.getLastAccessedTime() in test_SSLSession_getLastAccessedTime()

12