Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 13 for Multiplication (0.36 sec)

  1. src/main/java/jcifs/util/InputValidator.java

        }
    
        /**
         * Safe integer multiplication with overflow check
         *
         * @param a first operand
         * @param b second operand
         * @return product of a and b
         * @throws ArithmeticException if overflow occurs
         */
        public static int safeMultiply(int a, int b) {
            validateIntegerMultiplication(a, b, "Multiplication");
            return a * b;
        }
    
        /**
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 30 05:58:03 UTC 2025
    - 13.5K bytes
    - Viewed (0)
  2. src/main/java/jcifs/internal/smb2/rdma/RdmaErrorHandler.java

                        int safeShift = Math.min(MAX_BACKOFF_SHIFT, Math.max(0, retryCount - 1));
                        long multiplier = 1L << safeShift;
                        // Check for potential overflow before multiplication
                        long delay = (retryDelayMs > Long.MAX_VALUE / multiplier) ? MAX_RETRY_DELAY
                                : Math.min(MAX_RETRY_DELAY, retryDelayMs * multiplier);
                        Thread.sleep(delay);
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 30 05:58:03 UTC 2025
    - 10.5K bytes
    - Viewed (0)
  3. android/guava/src/com/google/common/hash/BloomFilterStrategies.java

          return true;
        }
      },
      /**
       * This strategy uses all 128 bits of {@link Hashing#murmur3_128} when hashing. It looks different
       * from the implementation in MURMUR128_MITZ_32 because we're avoiding the multiplication in the
       * loop and doing a (much simpler) += hash2. We're also changing the index to a positive number by
       * AND'ing with Long.MAX_VALUE instead of flipping the bits.
       */
      MURMUR128_MITZ_64() {
        @Override
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Sun Dec 22 03:38:46 UTC 2024
    - 10.6K bytes
    - Viewed (0)
  4. guava/src/com/google/common/math/PairedStatsAccumulator.java

        double ySumOfSquaresOfDeltas = yStats.sumOfSquaresOfDeltas();
        checkState(xSumOfSquaresOfDeltas > 0.0);
        checkState(ySumOfSquaresOfDeltas > 0.0);
        // The product of two positive numbers can be zero if the multiplication underflowed. We
        // force a positive value by effectively rounding up to MIN_VALUE.
        double productOfSumsOfSquaresOfDeltas =
            ensurePositive(xSumOfSquaresOfDeltas * ySumOfSquaresOfDeltas);
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Mon Apr 14 16:36:11 UTC 2025
    - 10.4K bytes
    - Viewed (0)
  5. android/guava-tests/test/com/google/common/util/concurrent/AbstractAbstractFutureTest.java

        assertEquals(1, future.get(-1, SECONDS).intValue());
      }
    
      @J2ktIncompatible
      @GwtIncompatible // threads
      public void testOverflowTimeout() throws Exception {
        // First, sanity check that naive multiplication would really overflow to a negative number:
        long nanosPerSecond = NANOSECONDS.convert(1, SECONDS);
        assertThat(nanosPerSecond * Long.MAX_VALUE).isLessThan(0L);
    
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 15.4K bytes
    - Viewed (0)
  6. src/test/java/jcifs/util/InputValidatorTest.java

            assertThrows(ArithmeticException.class, () -> InputValidator.safeAdd(Integer.MIN_VALUE, -1));
        }
    
        @Test
        @DisplayName("Test safe integer multiplication")
        void testSafeMultiplication() {
            assertEquals(100, InputValidator.safeMultiply(10, 10));
            assertEquals(-100, InputValidator.safeMultiply(10, -10));
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 30 05:58:03 UTC 2025
    - 11.9K bytes
    - Viewed (0)
  7. guava/src/com/google/common/math/PairedStats.java

        double ySumOfSquaresOfDeltas = yStats().sumOfSquaresOfDeltas();
        checkState(xSumOfSquaresOfDeltas > 0.0);
        checkState(ySumOfSquaresOfDeltas > 0.0);
        // The product of two positive numbers can be zero if the multiplication underflowed. We
        // force a positive value by effectively rounding up to MIN_VALUE.
        double productOfSumsOfSquaresOfDeltas =
            ensurePositive(xSumOfSquaresOfDeltas * ySumOfSquaresOfDeltas);
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Tue Jul 08 18:32:10 UTC 2025
    - 12.6K bytes
    - Viewed (0)
  8. src/main/java/jcifs/util/ServerResponseValidator.java

            if (result > Integer.MAX_VALUE || result < Integer.MIN_VALUE) {
                failedValidations.incrementAndGet();
                integerOverflowsPrevented.incrementAndGet();
                log.warn("Integer overflow in multiplication: {} * {} = {}", a, b, result);
                throw new SmbException("Integer overflow detected");
            }
            return (int) result;
        }
    
        /**
         * Validate SMB message size
         *
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 30 05:58:03 UTC 2025
    - 16.6K bytes
    - Viewed (0)
  9. guava/src/com/google/common/math/BigIntegerMath.java

        // Strip off 2s from this value.
        int shift = Long.numberOfTrailingZeros(product);
        product >>= shift;
    
        // Use floor(log2(num)) + 1 to prevent overflow of multiplication.
        int productBits = LongMath.log2(product, FLOOR) + 1;
        int bits = LongMath.log2(startingNumber, FLOOR) + 1;
        // Check for the next power of two boundary, to save us a CLZ operation.
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 18.8K bytes
    - Viewed (0)
  10. src/test/java/jcifs/internal/fscc/FileFsSizeInformationTest.java

                // When
                int bytesConsumed = fileFsSizeInfo.decode(bufferArray, 0, bufferArray.length);
    
                // Then
                assertEquals(24, bytesConsumed);
                // Note: multiplication may overflow, but that's expected behavior
                long expectedCapacity = Long.MAX_VALUE * (long) Integer.MAX_VALUE * (long) Integer.MAX_VALUE;
                assertEquals(expectedCapacity, fileFsSizeInfo.getCapacity());
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 25.9K bytes
    - Viewed (0)
Back to top