Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 80 for unsigned (0.18 sec)

  1. guava-tests/test/com/google/common/primitives/UnsignedIntsTest.java

        assertThat(UnsignedInts.saturatedCast(Long.MIN_VALUE)).isEqualTo(LEAST);
      }
    
      public void testToLong() {
        for (long a : UNSIGNED_INTS) {
          assertThat(UnsignedInts.toLong((int) a)).isEqualTo(a);
        }
      }
    
      public void testCompare() {
        for (long a : UNSIGNED_INTS) {
          for (long b : UNSIGNED_INTS) {
            int cmpAsLongs = Longs.compare(a, b);
            int cmpAsUInt = UnsignedInts.compare((int) a, (int) b);
    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)
  2. android/guava/src/com/google/common/collect/RegularImmutableMap.java

        Builder.DuplicateKey duplicateKey = null;
        if (tableSize <= BYTE_MAX_SIZE) {
          /*
           * Use 8 bits per entry. The value is unsigned to allow use up to a size of 2^8.
           *
           * The absent indicator of -1 signed becomes 2^8 - 1 unsigned, which reduces the actual max
           * size to 2^8 - 1. However, due to a load factor < 1 the limit is never approached.
           */
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Apr 15 22:32:14 GMT 2024
    - 22.7K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/primitives/UnsignedIntsTest.java

        assertThat(UnsignedInts.saturatedCast(Long.MIN_VALUE)).isEqualTo(LEAST);
      }
    
      public void testToLong() {
        for (long a : UNSIGNED_INTS) {
          assertThat(UnsignedInts.toLong((int) a)).isEqualTo(a);
        }
      }
    
      public void testCompare() {
        for (long a : UNSIGNED_INTS) {
          for (long b : UNSIGNED_INTS) {
            int cmpAsLongs = Longs.compare(a, b);
            int cmpAsUInt = UnsignedInts.compare((int) a, (int) b);
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Feb 06 16:10:08 GMT 2024
    - 12.7K bytes
    - Viewed (0)
  4. android/guava/src/com/google/common/math/LongMath.java

            long cmp = MAX_POWER_OF_SQRT2_UNSIGNED >>> leadingZeros;
            // floor(2^(logFloor + 0.5))
            int logFloor = (Long.SIZE - 1) - leadingZeros;
            return logFloor + lessThanBranchFree(cmp, x);
        }
        throw new AssertionError("impossible");
      }
    
      /** The biggest half power of two that fits into an unsigned long */
    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)
  5. android/guava/src/com/google/common/primitives/UnsignedLong.java

     * primitive utilities</a>.
     *
     * @author Louis Wasserman
     * @author Colin Evans
     * @since 11.0
     */
    @GwtCompatible(serializable = true)
    @ElementTypesAreNonnullByDefault
    public final class UnsignedLong extends Number implements Comparable<UnsignedLong>, Serializable {
    
      private static final long UNSIGNED_MASK = 0x7fffffffffffffffL;
    
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Apr 22 13:09:25 GMT 2021
    - 8.9K bytes
    - Viewed (0)
  6. guava/src/com/google/common/collect/CompactHashing.java

       * is unsigned, so the range of possible returned values is 0–255 or 0–65535, respectively.
       */
      static int tableGet(Object table, int index) {
        if (table instanceof byte[]) {
          return ((byte[]) table)[index] & BYTE_MASK; // unsigned read
        } else if (table instanceof short[]) {
          return ((short[]) table)[index] & SHORT_MASK; // unsigned read
        } else {
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Mon Aug 02 21:41:22 GMT 2021
    - 7.1K bytes
    - Viewed (0)
  7. android/guava/src/com/google/common/collect/CompactHashing.java

       * is unsigned, so the range of possible returned values is 0–255 or 0–65535, respectively.
       */
      static int tableGet(Object table, int index) {
        if (table instanceof byte[]) {
          return ((byte[]) table)[index] & BYTE_MASK; // unsigned read
        } else if (table instanceof short[]) {
          return ((short[]) table)[index] & SHORT_MASK; // unsigned read
        } else {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Aug 02 21:41:22 GMT 2021
    - 7.1K bytes
    - Viewed (0)
  8. android/guava/src/com/google/common/hash/Fingerprint2011.java

     *
     * <p>Note to maintainers: This implementation relies on signed arithmetic being bit-wise equivalent
     * to unsigned arithmetic in all cases except:
     *
     * <ul>
     *   <li>comparisons (signed values can be negative)
     *   <li>division (avoided here)
     *   <li>shifting (right shift must be unsigned)
     * </ul>
     *
     * @author ******@****.*** (Kyle Maddison)
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Dec 28 17:50:25 GMT 2021
    - 6.5K bytes
    - Viewed (0)
  9. android/guava/src/com/google/common/primitives/UnsignedLongs.java

       * longs, that is, {@code a <= b} as unsigned longs if and only if {@code flip(a) <= flip(b)} as
       * signed longs.
       */
      private static long flip(long a) {
        return a ^ Long.MIN_VALUE;
      }
    
      /**
       * Compares the two specified {@code long} values, treating them as unsigned values between {@code
       * 0} and {@code 2^64 - 1} inclusive.
       *
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Feb 15 16:12:13 GMT 2024
    - 17.6K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/hash/Hashing.java

       *
       * <p>This is designed for generating persistent fingerprints of strings. It isn't
       * cryptographically secure, but it produces a high-quality hash with few collisions. Fingerprints
       * generated using this are byte-wise identical to those created using the C++ version, but note
       * that this uses unsigned integers (see {@link com.google.common.primitives.UnsignedInts}).
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Apr 09 00:37:15 GMT 2024
    - 29.2K bytes
    - Viewed (0)
Back to top