Home
last modified time | relevance | path

Searched refs:saturatedCast (Results 1 – 25 of 62) sorted by relevance

123

/external/guava/guava-tests/test/com/google/common/primitives/
DSignedBytesTest.java57 assertEquals(value, SignedBytes.saturatedCast((long) value)); in testSaturatedCast()
59 assertEquals(GREATEST, SignedBytes.saturatedCast(GREATEST + 1L)); in testSaturatedCast()
60 assertEquals(LEAST, SignedBytes.saturatedCast(LEAST - 1L)); in testSaturatedCast()
61 assertEquals(GREATEST, SignedBytes.saturatedCast(Long.MAX_VALUE)); in testSaturatedCast()
62 assertEquals(LEAST, SignedBytes.saturatedCast(Long.MIN_VALUE)); in testSaturatedCast()
DUnsignedIntsTest.java74 assertEquals(value, UnsignedInts.toLong(UnsignedInts.saturatedCast(value))); in testSaturatedCast()
76 assertEquals(GREATEST, UnsignedInts.saturatedCast(1L << 32)); in testSaturatedCast()
77 assertEquals(LEAST, UnsignedInts.saturatedCast(-1L)); in testSaturatedCast()
78 assertEquals(GREATEST, UnsignedInts.saturatedCast(Long.MAX_VALUE)); in testSaturatedCast()
79 assertEquals(LEAST, UnsignedInts.saturatedCast(Long.MIN_VALUE)); in testSaturatedCast()
DUnsignedBytesTest.java62 assertEquals(value, UnsignedBytes.saturatedCast(UnsignedBytes.toInt(value))); in testSaturatedCast()
64 assertEquals(GREATEST, UnsignedBytes.saturatedCast(256L)); in testSaturatedCast()
65 assertEquals(LEAST, UnsignedBytes.saturatedCast(-1L)); in testSaturatedCast()
66 assertEquals(GREATEST, UnsignedBytes.saturatedCast(Long.MAX_VALUE)); in testSaturatedCast()
67 assertEquals(LEAST, UnsignedBytes.saturatedCast(Long.MIN_VALUE)); in testSaturatedCast()
DCharsTest.java67 assertEquals(value, Chars.saturatedCast((long) value)); in testSaturatedCast()
69 assertEquals(GREATEST, Chars.saturatedCast(GREATEST + 1L)); in testSaturatedCast()
70 assertEquals(LEAST, Chars.saturatedCast(LEAST - 1L)); in testSaturatedCast()
71 assertEquals(GREATEST, Chars.saturatedCast(Long.MAX_VALUE)); in testSaturatedCast()
72 assertEquals(LEAST, Chars.saturatedCast(Long.MIN_VALUE)); in testSaturatedCast()
DShortsTest.java68 assertEquals(value, Shorts.saturatedCast((long) value)); in testSaturatedCast()
70 assertEquals(GREATEST, Shorts.saturatedCast(GREATEST + 1L)); in testSaturatedCast()
71 assertEquals(LEAST, Shorts.saturatedCast(LEAST - 1L)); in testSaturatedCast()
72 assertEquals(GREATEST, Shorts.saturatedCast(Long.MAX_VALUE)); in testSaturatedCast()
73 assertEquals(LEAST, Shorts.saturatedCast(Long.MIN_VALUE)); in testSaturatedCast()
DIntsTest.java68 assertEquals(value, Ints.saturatedCast((long) value)); in testSaturatedCast()
70 assertEquals(GREATEST, Ints.saturatedCast(GREATEST + 1L)); in testSaturatedCast()
71 assertEquals(LEAST, Ints.saturatedCast(LEAST - 1L)); in testSaturatedCast()
72 assertEquals(GREATEST, Ints.saturatedCast(Long.MAX_VALUE)); in testSaturatedCast()
73 assertEquals(LEAST, Ints.saturatedCast(Long.MIN_VALUE)); in testSaturatedCast()
/external/guava/android/guava-tests/test/com/google/common/primitives/
DSignedBytesTest.java57 assertEquals(value, SignedBytes.saturatedCast((long) value)); in testSaturatedCast()
59 assertEquals(GREATEST, SignedBytes.saturatedCast(GREATEST + 1L)); in testSaturatedCast()
60 assertEquals(LEAST, SignedBytes.saturatedCast(LEAST - 1L)); in testSaturatedCast()
61 assertEquals(GREATEST, SignedBytes.saturatedCast(Long.MAX_VALUE)); in testSaturatedCast()
62 assertEquals(LEAST, SignedBytes.saturatedCast(Long.MIN_VALUE)); in testSaturatedCast()
DUnsignedIntsTest.java74 assertEquals(value, UnsignedInts.toLong(UnsignedInts.saturatedCast(value))); in testSaturatedCast()
76 assertEquals(GREATEST, UnsignedInts.saturatedCast(1L << 32)); in testSaturatedCast()
77 assertEquals(LEAST, UnsignedInts.saturatedCast(-1L)); in testSaturatedCast()
78 assertEquals(GREATEST, UnsignedInts.saturatedCast(Long.MAX_VALUE)); in testSaturatedCast()
79 assertEquals(LEAST, UnsignedInts.saturatedCast(Long.MIN_VALUE)); in testSaturatedCast()
DUnsignedBytesTest.java62 assertEquals(value, UnsignedBytes.saturatedCast(UnsignedBytes.toInt(value))); in testSaturatedCast()
64 assertEquals(GREATEST, UnsignedBytes.saturatedCast(256L)); in testSaturatedCast()
65 assertEquals(LEAST, UnsignedBytes.saturatedCast(-1L)); in testSaturatedCast()
66 assertEquals(GREATEST, UnsignedBytes.saturatedCast(Long.MAX_VALUE)); in testSaturatedCast()
67 assertEquals(LEAST, UnsignedBytes.saturatedCast(Long.MIN_VALUE)); in testSaturatedCast()
DCharsTest.java67 assertEquals(value, Chars.saturatedCast((long) value)); in testSaturatedCast()
69 assertEquals(GREATEST, Chars.saturatedCast(GREATEST + 1L)); in testSaturatedCast()
70 assertEquals(LEAST, Chars.saturatedCast(LEAST - 1L)); in testSaturatedCast()
71 assertEquals(GREATEST, Chars.saturatedCast(Long.MAX_VALUE)); in testSaturatedCast()
72 assertEquals(LEAST, Chars.saturatedCast(Long.MIN_VALUE)); in testSaturatedCast()
DShortsTest.java68 assertEquals(value, Shorts.saturatedCast((long) value)); in testSaturatedCast()
70 assertEquals(GREATEST, Shorts.saturatedCast(GREATEST + 1L)); in testSaturatedCast()
71 assertEquals(LEAST, Shorts.saturatedCast(LEAST - 1L)); in testSaturatedCast()
72 assertEquals(GREATEST, Shorts.saturatedCast(Long.MAX_VALUE)); in testSaturatedCast()
73 assertEquals(LEAST, Shorts.saturatedCast(Long.MIN_VALUE)); in testSaturatedCast()
DIntsTest.java68 assertEquals(value, Ints.saturatedCast((long) value)); in testSaturatedCast()
70 assertEquals(GREATEST, Ints.saturatedCast(GREATEST + 1L)); in testSaturatedCast()
71 assertEquals(LEAST, Ints.saturatedCast(LEAST - 1L)); in testSaturatedCast()
72 assertEquals(GREATEST, Ints.saturatedCast(Long.MAX_VALUE)); in testSaturatedCast()
73 assertEquals(LEAST, Ints.saturatedCast(Long.MIN_VALUE)); in testSaturatedCast()
/external/guava/guava/src/com/google/common/math/
DIntMath.java536 return Ints.saturatedCast((long) a + b);
547 return Ints.saturatedCast((long) a - b);
558 return Ints.saturatedCast((long) a * b);
/external/guava/android/guava/src/com/google/common/math/
DIntMath.java536 return Ints.saturatedCast((long) a + b);
547 return Ints.saturatedCast((long) a - b);
558 return Ints.saturatedCast((long) a * b);
/external/guava/android/guava-tests/test/com/google/common/math/
DIntMathTest.java556 a, b, "s+", saturatedCast(valueOf(a).add(valueOf(b))), IntMath.saturatedAdd(a, b)); in testSaturatedAdd()
570 saturatedCast(valueOf(a).subtract(valueOf(b))), in testSaturatedSubtract()
585 saturatedCast(valueOf(a).multiply(valueOf(b))), in testSaturatedMultiply()
596 a, b, "s^", saturatedCast(valueOf(a).pow(b)), IntMath.saturatedPow(a, b)); in testSaturatedPow()
604 private static int saturatedCast(BigInteger big) { in saturatedCast() method in IntMathTest
DLongMathTest.java665 a, b, "s+", saturatedCast(valueOf(a).add(valueOf(b))), LongMath.saturatedAdd(a, b)); in testSaturatedAdd()
679 saturatedCast(valueOf(a).subtract(valueOf(b))), in testSaturatedSubtract()
694 saturatedCast(valueOf(a).multiply(valueOf(b))), in testSaturatedMultiply()
705 a, b, "s^", saturatedCast(valueOf(a).pow(b)), LongMath.saturatedPow(a, b)); in testSaturatedPow()
873 private static long saturatedCast(BigInteger big) { in saturatedCast() method in LongMathTest
/external/guava/guava-tests/test/com/google/common/math/
DIntMathTest.java556 a, b, "s+", saturatedCast(valueOf(a).add(valueOf(b))), IntMath.saturatedAdd(a, b)); in testSaturatedAdd()
570 saturatedCast(valueOf(a).subtract(valueOf(b))), in testSaturatedSubtract()
585 saturatedCast(valueOf(a).multiply(valueOf(b))), in testSaturatedMultiply()
596 a, b, "s^", saturatedCast(valueOf(a).pow(b)), IntMath.saturatedPow(a, b)); in testSaturatedPow()
604 private static int saturatedCast(BigInteger big) { in saturatedCast() method in IntMathTest
DLongMathTest.java665 a, b, "s+", saturatedCast(valueOf(a).add(valueOf(b))), LongMath.saturatedAdd(a, b)); in testSaturatedAdd()
679 saturatedCast(valueOf(a).subtract(valueOf(b))), in testSaturatedSubtract()
694 saturatedCast(valueOf(a).multiply(valueOf(b))), in testSaturatedMultiply()
705 a, b, "s^", saturatedCast(valueOf(a).pow(b)), LongMath.saturatedPow(a, b)); in testSaturatedPow()
873 private static long saturatedCast(BigInteger big) { in saturatedCast() method in LongMathTest
/external/guava/guava/src/com/google/common/collect/
DJdkBackedImmutableMultiset.java88 return Ints.saturatedCast(size); in size()
DRegularImmutableSortedMultiset.java97 return Ints.saturatedCast(size); in size()
/external/guava/android/guava/src/com/google/common/primitives/
DSignedBytes.java70 public static byte saturatedCast(long value) { in saturatedCast() method in SignedBytes
/external/guava/guava/src/com/google/common/primitives/
DSignedBytes.java70 public static byte saturatedCast(long value) { in saturatedCast() method in SignedBytes
DUnsignedInts.java107 public static int saturatedCast(long value) { in saturatedCast() method in UnsignedInts
/external/guava/android/guava/src/com/google/common/collect/
DRegularImmutableMultiset.java49 this.size = Ints.saturatedCast(size); in RegularImmutableMultiset()
DRegularImmutableSortedMultiset.java88 return Ints.saturatedCast(size); in size()

123