Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 13 for nextDown (0.24 sec)

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

     */
    public class DoubleUtilsTest extends TestCase {
      @AndroidIncompatible // no FpUtils and no Math.nextDown in old versions
      public void testNextDown() throws Exception {
        Method jdkNextDown = getJdkNextDown();
        for (double d : FINITE_DOUBLE_CANDIDATES) {
          assertEquals(jdkNextDown.invoke(null, d), DoubleUtils.nextDown(d));
        }
      }
    
      private static Method getJdkNextDown() throws Exception {
        try {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 2.9K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/math/ToDoubleRounder.java

                ? roundArbitrarily
                : DoubleUtils.nextDown(roundArbitrarily);
          case CEILING:
            return (cmpXToRoundArbitrarily <= 0) ? roundArbitrarily : Math.nextUp(roundArbitrarily);
          case DOWN:
            if (sign(x) >= 0) {
              return (cmpXToRoundArbitrarily >= 0)
                  ? roundArbitrarily
                  : DoubleUtils.nextDown(roundArbitrarily);
            } else {
    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)
  3. guava-tests/test/com/google/common/math/DoubleUtilsTest.java

     */
    public class DoubleUtilsTest extends TestCase {
      @AndroidIncompatible // no FpUtils and no Math.nextDown in old versions
      public void testNextDown() throws Exception {
        Method jdkNextDown = getJdkNextDown();
        for (double d : FINITE_DOUBLE_CANDIDATES) {
          assertEquals(jdkNextDown.invoke(null, d), DoubleUtils.nextDown(d));
        }
      }
    
      private static Method getJdkNextDown() throws Exception {
        try {
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 2.9K bytes
    - Viewed (0)
  4. android/guava-tests/test/com/google/common/math/BigDecimalMathTest.java

            .setExpectation(DoubleUtils.nextDown(-Math.pow(2, 54)), FLOOR, UP)
            .roundUnnecessaryShouldThrow()
            .test();
      }
    
      public void testRoundToDouble_negativeTwoToThe54MinusThree() {
        new RoundToDoubleTester(BigDecimal.valueOf((-1L << 54) - 3))
            .setExpectation(-Math.pow(2, 54), DOWN, CEILING)
            .setExpectation(
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 10.6K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/math/BigDecimalMathTest.java

            .setExpectation(DoubleUtils.nextDown(-Math.pow(2, 54)), FLOOR, UP)
            .roundUnnecessaryShouldThrow()
            .test();
      }
    
      public void testRoundToDouble_negativeTwoToThe54MinusThree() {
        new RoundToDoubleTester(BigDecimal.valueOf((-1L << 54) - 3))
            .setExpectation(-Math.pow(2, 54), DOWN, CEILING)
            .setExpectation(
    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/DoubleUtils.java

    /**
     * Utilities for {@code double} primitives.
     *
     * @author Louis Wasserman
     */
    @GwtIncompatible
    @ElementTypesAreNonnullByDefault
    final class DoubleUtils {
      private DoubleUtils() {}
    
      static double nextDown(double d) {
        return -Math.nextUp(-d);
      }
    
      // The mask for the significand, according to the {@link
      // Double#doubleToRawLongBits(double)} spec.
      static final long SIGNIFICAND_MASK = 0x000fffffffffffffL;
    
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Apr 28 15:37:52 GMT 2021
    - 5.1K bytes
    - Viewed (0)
  7. guava-tests/test/com/google/common/math/BigIntegerMathTest.java

        new RoundToDoubleTester(BigInteger.valueOf((-1L << 53) - 1))
            .setExpectation(-Math.pow(2, 53), DOWN, CEILING, HALF_DOWN, HALF_EVEN)
            .setExpectation(DoubleUtils.nextDown(-Math.pow(2, 53)), FLOOR, UP, HALF_UP)
            .roundUnnecessaryShouldThrow()
            .test();
      }
    
      @J2ktIncompatible
      @GwtIncompatible
      public void testRoundToDouble_negativeTwoToThe54MinusOne() {
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Feb 07 17:50:39 GMT 2024
    - 28.2K bytes
    - Viewed (0)
  8. android/guava-tests/test/com/google/common/math/BigIntegerMathTest.java

        new RoundToDoubleTester(BigInteger.valueOf((-1L << 53) - 1))
            .setExpectation(-Math.pow(2, 53), DOWN, CEILING, HALF_DOWN, HALF_EVEN)
            .setExpectation(DoubleUtils.nextDown(-Math.pow(2, 53)), FLOOR, UP, HALF_UP)
            .roundUnnecessaryShouldThrow()
            .test();
      }
    
      @J2ktIncompatible
      @GwtIncompatible
      public void testRoundToDouble_negativeTwoToThe54MinusOne() {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Feb 07 17:50:39 GMT 2024
    - 28.2K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/math/MathTesting.java

          for (int direction : new int[] {1, -1}) {
            double d = Double.longBitsToDouble(Double.doubleToLongBits(Math.scalb(1.0, i)) + direction);
            // Math.nextUp/nextDown
            if (d != Math.rint(d)) {
              fractionalBuilder.add(d);
            }
          }
        }
        for (double d :
            Doubles.asList(
                0,
                1,
                2,
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Mon Oct 10 19:45:10 GMT 2022
    - 11.2K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/math/LongMath.java

                ? roundArbitrarily
                : DoubleUtils.nextDown(roundArbitrarily);
          case CEILING:
            return (cmpXToRoundArbitrarily <= 0) ? roundArbitrarily : Math.nextUp(roundArbitrarily);
          case DOWN:
            if (x >= 0) {
              return (cmpXToRoundArbitrarily >= 0)
                  ? roundArbitrarily
                  : DoubleUtils.nextDown(roundArbitrarily);
            } else {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Feb 07 17:50:39 GMT 2024
    - 44.6K bytes
    - Viewed (0)
Back to top