Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 27 for subtract (0.17 sec)

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

      }
    
      public void testIsPowerOfTwo() {
        for (BigInteger x : ALL_BIGINTEGER_CANDIDATES) {
          // Checks for a single bit set.
          boolean expected = x.signum() > 0 & x.and(x.subtract(ONE)).equals(ZERO);
          assertEquals(expected, BigIntegerMath.isPowerOfTwo(x));
        }
      }
    
      public void testLog2ZeroAlwaysThrows() {
        for (RoundingMode mode : ALL_ROUNDING_MODES) {
          try {
    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)
  2. android/guava-tests/test/com/google/common/math/BigIntegerMathTest.java

      }
    
      public void testIsPowerOfTwo() {
        for (BigInteger x : ALL_BIGINTEGER_CANDIDATES) {
          // Checks for a single bit set.
          boolean expected = x.signum() > 0 & x.and(x.subtract(ONE)).equals(ZERO);
          assertEquals(expected, BigIntegerMath.isPowerOfTwo(x));
        }
      }
    
      public void testLog2ZeroAlwaysThrows() {
        for (RoundingMode mode : ALL_ROUNDING_MODES) {
          try {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Feb 07 17:50:39 GMT 2024
    - 28.2K bytes
    - Viewed (0)
  3. android/guava/src/com/google/common/collect/DiscreteDomain.java

          return value.subtract(BigInteger.ONE);
        }
    
        @Override
        BigInteger offset(BigInteger origin, long distance) {
          checkNonnegative(distance, "distance");
          return origin.add(BigInteger.valueOf(distance));
        }
    
        @Override
        public long distance(BigInteger start, BigInteger end) {
          return end.subtract(start).max(MIN_LONG).min(MAX_LONG).longValue();
        }
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Feb 22 21:19:52 GMT 2024
    - 10.3K bytes
    - Viewed (0)
  4. guava/src/com/google/common/collect/DiscreteDomain.java

          return value.subtract(BigInteger.ONE);
        }
    
        @Override
        BigInteger offset(BigInteger origin, long distance) {
          checkNonnegative(distance, "distance");
          return origin.add(BigInteger.valueOf(distance));
        }
    
        @Override
        public long distance(BigInteger start, BigInteger end) {
          return end.subtract(start).max(MIN_LONG).min(MAX_LONG).longValue();
        }
    
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Thu Feb 22 21:19:52 GMT 2024
    - 10.3K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/math/LongMathTest.java

      }
    
      @AndroidIncompatible // slow
      public void testLessThanBranchFree() {
        for (long x : ALL_LONG_CANDIDATES) {
          for (long y : ALL_LONG_CANDIDATES) {
            BigInteger difference = BigInteger.valueOf(x).subtract(BigInteger.valueOf(y));
            if (fitsInLong(difference)) {
              int expected = (x < y) ? 1 : 0;
              int actual = LongMath.lessThanBranchFree(x, y);
              assertEquals(expected, actual);
            }
    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)
  6. guava-tests/test/com/google/common/primitives/UnsignedLongTest.java

          for (long b : TEST_LONGS) {
            UnsignedLong aUnsigned = UnsignedLong.fromLongBits(a);
            UnsignedLong bUnsigned = UnsignedLong.fromLongBits(b);
            long expected =
                aUnsigned.bigIntegerValue().subtract(bUnsigned.bigIntegerValue()).longValue();
            UnsignedLong unsignedSub = aUnsigned.minus(bUnsigned);
            assertThat(unsignedSub.longValue()).isEqualTo(expected);
          }
        }
      }
    
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Tue Feb 06 16:10:08 GMT 2024
    - 10.5K bytes
    - Viewed (0)
  7. android/guava/src/com/google/common/collect/CompactLinkedHashMap.java

        requireLinks()[i] = value;
      }
    
      /*
       * We don't define getPredecessor+getSuccessor and setPredecessor+setSuccessor here because
       * they're defined above -- including logic to add and subtract 1 to map between the values stored
       * in the predecessor/successor arrays and the indexes in the elements array that they identify.
       */
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Apr 01 16:15:01 GMT 2024
    - 8.5K bytes
    - Viewed (0)
  8. android/guava-tests/test/com/google/common/math/LongMathTest.java

      }
    
      @AndroidIncompatible // slow
      public void testLessThanBranchFree() {
        for (long x : ALL_LONG_CANDIDATES) {
          for (long y : ALL_LONG_CANDIDATES) {
            BigInteger difference = BigInteger.valueOf(x).subtract(BigInteger.valueOf(y));
            if (fitsInLong(difference)) {
              int expected = (x < y) ? 1 : 0;
              int actual = LongMath.lessThanBranchFree(x, y);
              assertEquals(expected, actual);
            }
    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)
  9. guava/src/com/google/common/collect/CompactLinkedHashMap.java

        requireLinks()[i] = value;
      }
    
      /*
       * We don't define getPredecessor+getSuccessor and setPredecessor+setSuccessor here because
       * they're defined above -- including logic to add and subtract 1 to map between the values stored
       * in the predecessor/successor arrays and the indexes in the elements array that they identify.
       */
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Mon Apr 01 16:15:01 GMT 2024
    - 10.2K bytes
    - Viewed (0)
  10. cmd/bitrot.go

    	for left > 0 {
    		// Read expected hash...
    		h.Reset()
    		n, err := io.ReadFull(r, hashBuf)
    		if err != nil {
    			// Read's failed for object with right size, file is corrupt.
    			return err
    		}
    		// Subtract hash length..
    		left -= int64(n)
    		if left < shardSize {
    			shardSize = left
    		}
    
    		read, err := io.CopyBuffer(h, io.LimitReader(r, shardSize), *bufp)
    		if err != nil {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Tue Jan 30 20:43:25 GMT 2024
    - 7.6K bytes
    - Viewed (0)
Back to top