Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 405 for unnecessary (0.25 sec)

  1. guava-tests/test/com/google/common/math/LongMathTest.java

          } catch (ArithmeticException expected) {
            // do nothing
          }
    
          if (expectedDouble != null) {
            assertThat(LongMath.roundToDouble(candidate, UNNECESSARY)).isEqualTo(expectedDouble);
          } else {
            try {
              LongMath.roundToDouble(candidate, UNNECESSARY);
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Mon Mar 04 20:15:57 GMT 2024
    - 32.5K bytes
    - Viewed (0)
  2. android/guava-tests/test/com/google/common/math/LongMathTest.java

          } catch (ArithmeticException expected) {
            // do nothing
          }
    
          if (expectedDouble != null) {
            assertThat(LongMath.roundToDouble(candidate, UNNECESSARY)).isEqualTo(expectedDouble);
          } else {
            try {
              LongMath.roundToDouble(candidate, UNNECESSARY);
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Mar 04 20:15:57 GMT 2024
    - 32.5K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/math/DoubleMathTest.java

          // every mode except UNNECESSARY
          BigDecimal expected = new BigDecimal(d).setScale(0, UNNECESSARY);
          boolean isInBounds =
              expected.compareTo(MAX_LONG_AS_BIG_DECIMAL) <= 0
                  & expected.compareTo(MIN_LONG_AS_BIG_DECIMAL) >= 0;
    
          try {
            assertEquals(expected.longValue(), DoubleMath.roundToLong(d, UNNECESSARY));
            assertTrue(isInBounds);
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Feb 07 17:50:39 GMT 2024
    - 28.1K bytes
    - Viewed (0)
  4. guava-tests/test/com/google/common/math/DoubleMathTest.java

          // every mode except UNNECESSARY
          BigDecimal expected = new BigDecimal(d).setScale(0, UNNECESSARY);
          boolean isInBounds =
              expected.compareTo(MAX_LONG_AS_BIG_DECIMAL) <= 0
                  & expected.compareTo(MIN_LONG_AS_BIG_DECIMAL) >= 0;
    
          try {
            assertEquals(expected.longValue(), DoubleMath.roundToLong(d, UNNECESSARY));
            assertTrue(isInBounds);
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Feb 07 17:50:39 GMT 2024
    - 28.1K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/math/BigDecimalMathTest.java

          if (!expectedValues.containsKey(UNNECESSARY)) {
            assertWithMessage("Expected roundUnnecessaryShouldThrow call")
                .that(unnecessaryShouldThrow)
                .isTrue();
            assertThrows(
                "Expected ArithmeticException for roundToDouble(" + input + ", UNNECESSARY)",
                ArithmeticException.class,
                () -> BigDecimalMath.roundToDouble(input, UNNECESSARY));
          }
        }
      }
    
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 10.6K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/math/ToDoubleRounder.java

            case UP:
              return roundArbitrarily;
            case UNNECESSARY:
              throw new ArithmeticException(x + " cannot be represented precisely as a double");
          }
        }
        X roundArbitrarilyAsX = toX(roundArbitrarily, RoundingMode.UNNECESSARY);
        int cmpXToRoundArbitrarily = x.compareTo(roundArbitrarilyAsX);
        switch (mode) {
          case UNNECESSARY:
            checkRoundingUnnecessary(cmpXToRoundArbitrarily == 0);
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Feb 07 17:50:39 GMT 2024
    - 5.8K bytes
    - Viewed (0)
  7. android/guava-tests/test/com/google/common/math/BigDecimalMathTest.java

          if (!expectedValues.containsKey(UNNECESSARY)) {
            assertWithMessage("Expected roundUnnecessaryShouldThrow call")
                .that(unnecessaryShouldThrow)
                .isTrue();
            assertThrows(
                "Expected ArithmeticException for roundToDouble(" + input + ", UNNECESSARY)",
                ArithmeticException.class,
                () -> BigDecimalMath.roundToDouble(input, UNNECESSARY));
          }
        }
      }
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 10.6K bytes
    - Viewed (0)
  8. android/guava/src/com/google/common/math/IntMath.java

       * @throws ArithmeticException if {@code mode} is {@link RoundingMode#UNNECESSARY} and {@code x}
       *     is not a power of two
       */
      @SuppressWarnings("fallthrough")
      // TODO(kevinb): remove after this warning is disabled globally
      public static int log2(int x, RoundingMode mode) {
        checkPositive("x", x);
        switch (mode) {
          case UNNECESSARY:
            checkRoundingUnnecessary(isPowerOfTwo(x));
            // fall through
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Feb 07 17:50:39 GMT 2024
    - 23.5K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/math/IntMathTest.java

    import static com.google.common.math.TestPlatform.intsCanGoOutOfRange;
    import static java.math.BigInteger.valueOf;
    import static java.math.RoundingMode.FLOOR;
    import static java.math.RoundingMode.UNNECESSARY;
    
    import com.google.common.annotations.GwtCompatible;
    import com.google.common.annotations.GwtIncompatible;
    import com.google.common.annotations.J2ktIncompatible;
    import com.google.common.testing.NullPointerTester;
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Feb 07 17:50:39 GMT 2024
    - 24.5K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/math/BigIntegerMath.java

       *     is not a power of two
       */
      @SuppressWarnings("fallthrough")
      // TODO(kevinb): remove after this warning is disabled globally
      public static int log2(BigInteger x, RoundingMode mode) {
        checkPositive("x", checkNotNull(x));
        int logFloor = x.bitLength() - 1;
        switch (mode) {
          case UNNECESSARY:
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Feb 07 17:50:39 GMT 2024
    - 18.9K bytes
    - Viewed (0)
Back to top