Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 327 for signum (0.33 sec)

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

       */
      static BigInteger randomPositiveBigInteger(int numBits) {
        BigInteger result;
        do {
          result = randomNonNegativeBigInteger(numBits);
        } while (result.signum() == 0);
        return result;
      }
    
      /**
       * Generates a number in [0, 2^numBits) with an exponential distribution. The floor of the log2 of
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 4.1K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/collect/ComparisonChainTest.java

                new Foo("b", 1, null));
        for (Foo a : instances) {
          for (Foo b : instances) {
            int comparedUsingComparisonChain = signum(comparatorUsingComparisonChain.compare(a, b));
            int comparedUsingComparatorMethods = signum(comparatorUsingComparatorMethods.compare(a, b));
            assertWithMessage("%s vs %s", a, b)
                .that(comparedUsingComparatorMethods)
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Tue Feb 27 13:27:08 GMT 2024
    - 7.5K bytes
    - Viewed (0)
  3. android/guava/src/com/google/common/math/MathPreconditions.java

          throw new IllegalArgumentException(role + " (" + x + ") must be > 0");
        }
        return x;
      }
    
      @CanIgnoreReturnValue
      static BigInteger checkPositive(String role, BigInteger x) {
        if (x.signum() <= 0) {
          throw new IllegalArgumentException(role + " (" + x + ") must be > 0");
        }
        return x;
      }
    
      @CanIgnoreReturnValue
      static int checkNonNegative(String role, int x) {
        if (x < 0) {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Jun 15 20:59:00 GMT 2022
    - 3.3K bytes
    - Viewed (0)
  4. android/guava-tests/test/com/google/common/math/MathBenchmarking.java

       */
      static BigInteger randomPositiveBigInteger(int numBits) {
        BigInteger result;
        do {
          result = randomNonNegativeBigInteger(numBits);
        } while (result.signum() == 0);
        return result;
      }
    
      /**
       * Generates a number in [0, 2^numBits) with an exponential distribution. The floor of the log2 of
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 4.1K bytes
    - Viewed (0)
  5. android/guava/src/com/google/common/math/DoubleUtils.java

         * directly. If the exponent is MAX_DOUBLE_EXPONENT, we round up (correctly) to
         * Double.POSITIVE_INFINITY.
         */
        bits |= x.signum() & SIGN_MASK;
        return longBitsToDouble(bits);
      }
    
      /** Returns its argument if it is non-negative, zero if it is negative. */
      static double ensureNonNegative(double value) {
        checkArgument(!isNaN(value));
    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. android/guava/src/com/google/common/math/IntMath.java

         * deal with the cases where rounding towards 0 is wrong, which typically depends on the sign of
         * p / q.
         *
         * signum is 1 if p and q are both nonnegative or both negative, and -1 otherwise.
         */
        int signum = 1 | ((p ^ q) >> (Integer.SIZE - 1));
        boolean increment;
        switch (mode) {
          case UNNECESSARY:
    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)
  7. android/guava/src/com/google/common/math/BigDecimalMath.java

        @Override
        double roundToDoubleArbitrarily(BigDecimal bigDecimal) {
          return bigDecimal.doubleValue();
        }
    
        @Override
        int sign(BigDecimal bigDecimal) {
          return bigDecimal.signum();
        }
    
        @Override
        BigDecimal toX(double d, RoundingMode mode) {
          return new BigDecimal(d);
        }
    
        @Override
        BigDecimal minus(BigDecimal a, BigDecimal b) {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Feb 23 18:45:50 GMT 2023
    - 3.1K bytes
    - Viewed (0)
  8. android/guava-tests/test/com/google/common/primitives/UnsignedBytesTest.java

          for (int j = 0; j < VALUES.length; j++) {
            byte x = VALUES[i];
            byte y = VALUES[j];
            // note: spec requires only that the sign is the same
            assertWithMessage(x + ", " + y)
                .that(Math.signum(Ints.compare(i, j)))
                .isEqualTo(Math.signum(UnsignedBytes.compare(x, y)));
          }
        }
      }
    
      public void testMax_noArgs() {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Feb 20 17:00:05 GMT 2024
    - 13.4K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/primitives/UnsignedIntsTest.java

        for (long a : UNSIGNED_INTS) {
          for (long b : UNSIGNED_INTS) {
            int cmpAsLongs = Longs.compare(a, b);
            int cmpAsUInt = UnsignedInts.compare((int) a, (int) b);
            assertThat(Integer.signum(cmpAsUInt)).isEqualTo(Integer.signum(cmpAsLongs));
          }
        }
      }
    
      public void testMax_noArgs() {
        try {
          UnsignedInts.max();
          fail();
        } catch (IllegalArgumentException expected) {
        }
      }
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Tue Feb 06 16:10:08 GMT 2024
    - 12.7K bytes
    - Viewed (0)
  10. guava-tests/test/com/google/common/primitives/UnsignedBytesTest.java

          for (int j = 0; j < VALUES.length; j++) {
            byte x = VALUES[i];
            byte y = VALUES[j];
            // note: spec requires only that the sign is the same
            assertWithMessage(x + ", " + y)
                .that(Math.signum(Ints.compare(i, j)))
                .isEqualTo(Math.signum(UnsignedBytes.compare(x, y)));
          }
        }
      }
    
      public void testMax_noArgs() {
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Tue Feb 20 17:00:05 GMT 2024
    - 13.4K bytes
    - Viewed (0)
Back to top