Search Options

Results per page
Sort
Preferred Languages
Advance

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

  1. 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 {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Feb 07 17:50:39 UTC 2024
    - 5.8K bytes
    - Viewed (0)
  2. 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 {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Jul 03 18:10:55 UTC 2024
    - 3K bytes
    - Viewed (0)
  3. 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 {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Feb 07 17:50:39 UTC 2024
    - 5.8K bytes
    - Viewed (0)
  4. 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 {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Jul 03 18:10:55 UTC 2024
    - 3K bytes
    - Viewed (0)
  5. 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(
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Sep 06 17:04:31 UTC 2023
    - 10.6K bytes
    - Viewed (0)
  6. 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;
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:26:48 UTC 2024
    - 5.1K bytes
    - Viewed (0)
  7. 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;
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:26:48 UTC 2024
    - 5.1K bytes
    - Viewed (0)
  8. 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 {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 09 16:39:37 UTC 2024
    - 45.2K bytes
    - Viewed (0)
  9. 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 {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 09 16:39:37 UTC 2024
    - 45.2K bytes
    - Viewed (0)
  10. 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,
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Oct 10 19:45:10 UTC 2022
    - 11.2K bytes
    - Viewed (0)
Back to top