Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 16 for constrainToRange (0.05 sec)

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

      }
    
      public void testConstrainToRange() {
        assertThat(Shorts.constrainToRange((short) 1, (short) 0, (short) 5)).isEqualTo((short) 1);
        assertThat(Shorts.constrainToRange((short) 1, (short) 1, (short) 5)).isEqualTo((short) 1);
        assertThat(Shorts.constrainToRange((short) 1, (short) 3, (short) 5)).isEqualTo((short) 3);
        assertThat(Shorts.constrainToRange((short) 0, (short) -5, (short) -1)).isEqualTo((short) -1);
    Registered: Fri Dec 26 12:43:10 UTC 2025
    - Last Modified: Thu Dec 11 20:45:32 UTC 2025
    - 27.5K bytes
    - Viewed (0)
  2. android/guava-tests/test/com/google/common/primitives/CharsTest.java

      }
    
      public void testConstrainToRange() {
        assertThat(Chars.constrainToRange((char) 1, (char) 0, (char) 5)).isEqualTo((char) 1);
        assertThat(Chars.constrainToRange((char) 1, (char) 1, (char) 5)).isEqualTo((char) 1);
        assertThat(Chars.constrainToRange((char) 1, (char) 3, (char) 5)).isEqualTo((char) 3);
        assertThat(Chars.constrainToRange((char) 255, (char) 250, (char) 254)).isEqualTo((char) 254);
    Registered: Fri Dec 26 12:43:10 UTC 2025
    - Last Modified: Thu Dec 11 20:45:32 UTC 2025
    - 25.9K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/primitives/DoublesTest.java

      }
    
      public void testConstrainToRange() {
        assertThat(Doubles.constrainToRange(1.0, 0.0, 5.0)).isEqualTo(1.0);
        assertThat(Doubles.constrainToRange(1.0, 1.0, 5.0)).isEqualTo(1.0);
        assertThat(Doubles.constrainToRange(1.0, 3.0, 5.0)).isEqualTo(3.0);
        assertThat(Doubles.constrainToRange(0.0, -5.0, -1.0)).isEqualTo(-1.0);
        assertThat(Doubles.constrainToRange(5.0, 2.0, 2.0)).isEqualTo(2.0);
    Registered: Fri Dec 26 12:43:10 UTC 2025
    - Last Modified: Thu Dec 11 20:45:32 UTC 2025
    - 30.9K bytes
    - Viewed (0)
  4. guava-tests/test/com/google/common/primitives/IntsTest.java

        assertThat(Ints.constrainToRange((int) 1, (int) 0, (int) 5)).isEqualTo((int) 1);
        assertThat(Ints.constrainToRange((int) 1, (int) 1, (int) 5)).isEqualTo((int) 1);
        assertThat(Ints.constrainToRange((int) 1, (int) 3, (int) 5)).isEqualTo((int) 3);
        assertThat(Ints.constrainToRange((int) 0, (int) -5, (int) -1)).isEqualTo((int) -1);
        assertThat(Ints.constrainToRange((int) 5, (int) 2, (int) 2)).isEqualTo((int) 2);
    Registered: Fri Dec 26 12:43:10 UTC 2025
    - Last Modified: Thu Dec 11 20:45:32 UTC 2025
    - 29.3K bytes
    - Viewed (0)
  5. guava/src/com/google/common/math/PairedStatsAccumulator.java

        if (value > 0.0) {
          return value;
        } else {
          return Double.MIN_VALUE;
        }
      }
    
      private static double ensureInUnitRange(double value) {
        return Doubles.constrainToRange(value, -1.0, 1.0);
      }
    Registered: Fri Dec 26 12:43:10 UTC 2025
    - Last Modified: Mon Sep 08 18:35:13 UTC 2025
    - 10.4K bytes
    - Viewed (0)
  6. guava/src/com/google/common/collect/CompactHashSet.java

      void init(int expectedSize) {
        Preconditions.checkArgument(expectedSize >= 0, "Expected size must be >= 0");
    
        // Save expectedSize for use in allocArrays()
        this.metadata = Ints.constrainToRange(expectedSize, 1, CompactHashing.MAX_SIZE);
      }
    
      /** Returns whether arrays need to be allocated. */
      boolean needsAllocArrays() {
        return table == null;
      }
    
    Registered: Fri Dec 26 12:43:10 UTC 2025
    - Last Modified: Tue Jul 08 18:32:10 UTC 2025
    - 24.7K bytes
    - Viewed (0)
  7. guava/src/com/google/common/collect/CompactHashMap.java

      void init(int expectedSize) {
        Preconditions.checkArgument(expectedSize >= 0, "Expected size must be >= 0");
    
        // Save expectedSize for use in allocArrays()
        this.metadata = Ints.constrainToRange(expectedSize, 1, CompactHashing.MAX_SIZE);
      }
    
      /** Returns whether arrays need to be allocated. */
      boolean needsAllocArrays() {
        return table == null;
      }
    
    Registered: Fri Dec 26 12:43:10 UTC 2025
    - Last Modified: Tue Jul 08 18:32:10 UTC 2025
    - 39.6K bytes
    - Viewed (0)
  8. android/guava/src/com/google/common/collect/CompactHashMap.java

      void init(int expectedSize) {
        Preconditions.checkArgument(expectedSize >= 0, "Expected size must be >= 0");
    
        // Save expectedSize for use in allocArrays()
        this.metadata = Ints.constrainToRange(expectedSize, 1, CompactHashing.MAX_SIZE);
      }
    
      /** Returns whether arrays need to be allocated. */
      boolean needsAllocArrays() {
        return table == null;
      }
    
    Registered: Fri Dec 26 12:43:10 UTC 2025
    - Last Modified: Sat Aug 09 01:14:59 UTC 2025
    - 35.7K bytes
    - Viewed (0)
  9. guava/src/com/google/common/primitives/Shorts.java

       * @param max the upper bound (inclusive) of the range to constrain {@code value} to
       * @throws IllegalArgumentException if {@code min > max}
       * @since 21.0
       */
      public static short constrainToRange(short value, short min, short max) {
        checkArgument(min <= max, "min (%s) must be less than or equal to max (%s)", min, max);
        return value < min ? min : value < max ? value : max;
      }
    
      /**
    Registered: Fri Dec 26 12:43:10 UTC 2025
    - Last Modified: Wed Oct 22 18:14:49 UTC 2025
    - 25.7K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/primitives/Chars.java

       * @param max the upper bound (inclusive) of the range to constrain {@code value} to
       * @throws IllegalArgumentException if {@code min > max}
       * @since 21.0
       */
      public static char constrainToRange(char value, char min, char max) {
        checkArgument(min <= max, "min (%s) must be less than or equal to max (%s)", min, max);
        return value < min ? min : value < max ? value : max;
      }
    
      /**
    Registered: Fri Dec 26 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 24.2K bytes
    - Viewed (0)
Back to top