- Sort Score
- Num 10 results
- Language All
Results 1 - 10 of 24 for multiplication (0.08 seconds)
-
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; } /**Created: Sun Apr 05 00:10:12 GMT 2026 - Last Modified: Sat Aug 30 05:58:03 GMT 2025 - 13.5K bytes - Click Count (0) -
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);
Created: Sun Apr 05 00:10:12 GMT 2026 - Last Modified: Sat Aug 30 05:58:03 GMT 2025 - 10.5K bytes - Click Count (0) -
guava-tests/benchmark/com/google/common/base/StringsRepeatBenchmark.java
if (x.length() != (originalString.length() * count)) { throw new RuntimeException("Wrong length: " + x); } } } private static String oldRepeat(String string, int count) { // If this multiplication overflows, a NegativeArraySizeException or // OutOfMemoryError is not far behind int len = string.length(); int size = len * count; char[] array = new char[size]; for (int i = 0; i < size; i += len) {
Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Tue May 13 18:46:00 GMT 2025 - 3.4K bytes - Click Count (0) -
android/guava-tests/benchmark/com/google/common/base/StringsRepeatBenchmark.java
if (x.length() != (originalString.length() * count)) { throw new RuntimeException("Wrong length: " + x); } } } private static String oldRepeat(String string, int count) { // If this multiplication overflows, a NegativeArraySizeException or // OutOfMemoryError is not far behind int len = string.length(); int size = len * count; char[] array = new char[size]; for (int i = 0; i < size; i += len) {
Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Tue May 13 18:46:00 GMT 2025 - 3.4K bytes - Click Count (0) -
android/guava-tests/benchmark/com/google/common/math/BigIntegerMathBenchmark.java
Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Thu Dec 19 18:03:30 GMT 2024 - 3.5K bytes - Click Count (0) -
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() { @OverrideCreated: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Thu Mar 19 18:53:45 GMT 2026 - 10.7K bytes - Click Count (0) -
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));
Created: Sun Apr 05 00:10:12 GMT 2026 - Last Modified: Sat Aug 30 05:58:03 GMT 2025 - 11.9K bytes - Click Count (0) -
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);
Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Mon Mar 16 22:45:21 GMT 2026 - 16.3K bytes - Click Count (0) -
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);
Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Mon Mar 16 22:45:21 GMT 2026 - 16.3K bytes - Click Count (0) -
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 *
Created: Sun Apr 05 00:10:12 GMT 2026 - Last Modified: Sat Aug 30 05:58:03 GMT 2025 - 16.6K bytes - Click Count (0)