Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for abs (0.14 sec)

  1. android/guava/src/com/google/common/math/DoubleMath.java

            return rint(x);
    
          case HALF_UP:
            {
              double z = rint(x);
              if (abs(x - z) == 0.5) {
                return x + copySign(0.5, x);
              } else {
                return z;
              }
            }
    
          case HALF_DOWN:
            {
              double z = rint(x);
              if (abs(x - z) == 0.5) {
                return x;
              } else {
                return z;
              }
    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)
  2. guava-tests/benchmark/com/google/common/collect/MinMaxPriorityQueueBenchmark.java

          for (double i = 0; i < 100; i += 20) {
            v =
                v.add(
                    v.multiply(
                        BigInteger.valueOf(((Double) Math.abs(Math.sin(i) * 10.0)).longValue())));
          }
          return v;
        }
      }
    
      public enum ComparatorType {
        CHEAP {
          @Override
          public Comparator<Integer> get() {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Apr 19 19:24:36 GMT 2023
    - 4.3K bytes
    - Viewed (0)
  3. android/guava/src/com/google/common/math/LongMath.java

            break;
          case HALF_EVEN:
          case HALF_DOWN:
          case HALF_UP:
            long absRem = abs(rem);
            long cmpRemToHalfDivisor = absRem - (abs(q) - absRem);
            // subtracting two nonnegative longs can't overflow
            // cmpRemToHalfDivisor has the same sign as compare(abs(rem), abs(q) / 2).
            if (cmpRemToHalfDivisor == 0) { // exactly on the half mark
    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)
  4. android/guava/src/com/google/common/math/IntMath.java

            break;
          case HALF_EVEN:
          case HALF_DOWN:
          case HALF_UP:
            int absRem = abs(rem);
            int cmpRemToHalfDivisor = absRem - (abs(q) - absRem);
            // subtracting two nonnegative ints can't overflow
            // cmpRemToHalfDivisor has the same sign as compare(abs(rem), abs(q) / 2).
            if (cmpRemToHalfDivisor == 0) { // exactly on the half mark
    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)
  5. android/guava/src/com/google/common/math/DoubleUtils.java

      }
    
      static double bigToDouble(BigInteger x) {
        // This is an extremely fast implementation of BigInteger.doubleValue(). JDK patch pending.
        BigInteger absX = x.abs();
        int exponent = absX.bitLength() - 1;
        // exponent == floor(log2(abs(x)))
        if (exponent < Long.SIZE - 1) {
          return x.longValue();
        } else if (exponent > MAX_EXPONENT) {
          return x.signum() * POSITIVE_INFINITY;
        }
    
        /*
    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)
  6. guava-tests/test/com/google/common/math/DoubleMathTest.java

        // decrement until it's <= the true value
        while (StrictMath.pow(2.0, trueLog2) > d) {
          trueLog2 = StrictMath.nextAfter(trueLog2, Double.NEGATIVE_INFINITY);
        }
        if (StrictMath.abs(StrictMath.pow(2.0, trueLog2) - d)
            > StrictMath.abs(StrictMath.pow(2.0, StrictMath.nextUp(trueLog2)) - d)) {
          trueLog2 = StrictMath.nextUp(trueLog2);
        }
        return trueLog2;
      }
    
    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)
  7. android/guava/src/com/google/common/util/concurrent/TimeoutFuture.java

              // to produce the message throws (probably StackOverflowError from delegate.toString())
              try {
                if (timer != null) {
                  long overDelayMs = Math.abs(timer.getDelay(TimeUnit.MILLISECONDS));
                  if (overDelayMs > 10) { // Not all timing drift is worth reporting
                    message += " (timeout delayed by " + overDelayMs + " ms after scheduled time)";
                  }
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Feb 01 21:46:34 GMT 2024
    - 7.7K bytes
    - Viewed (0)
  8. android/guava-tests/test/com/google/common/math/DoubleMathTest.java

        // decrement until it's <= the true value
        while (StrictMath.pow(2.0, trueLog2) > d) {
          trueLog2 = StrictMath.nextAfter(trueLog2, Double.NEGATIVE_INFINITY);
        }
        if (StrictMath.abs(StrictMath.pow(2.0, trueLog2) - d)
            > StrictMath.abs(StrictMath.pow(2.0, StrictMath.nextUp(trueLog2)) - d)) {
          trueLog2 = StrictMath.nextUp(trueLog2);
        }
        return trueLog2;
      }
    
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Feb 07 17:50:39 GMT 2024
    - 28.1K bytes
    - Viewed (0)
  9. android/guava-tests/benchmark/com/google/common/collect/MinMaxPriorityQueueBenchmark.java

          for (double i = 0; i < 100; i += 20) {
            v =
                v.add(
                    v.multiply(
                        BigInteger.valueOf(((Double) Math.abs(Math.sin(i) * 10.0)).longValue())));
          }
          return v;
        }
      }
    
      public enum ComparatorType {
        CHEAP {
          @Override
          public Comparator<Integer> get() {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Apr 19 19:24:36 GMT 2023
    - 4.3K bytes
    - Viewed (0)
Back to top