Lines Matching full:overflow

124 /* Range overflow checks.
128 arithmetic overflow. They do not rely on undefined or
138 printf ("multiply would overflow");
158 /* Return 1 if A + B would overflow in [MIN,MAX] arithmetic.
165 /* Return 1 if A - B would overflow in [MIN,MAX] arithmetic.
172 /* Return 1 if - A would overflow in [MIN,MAX] arithmetic.
179 /* Return 1 if A * B would overflow in [MIN,MAX] arithmetic.
196 /* Return 1 if A / B would overflow in [MIN,MAX] arithmetic.
201 /* Return 1 if A % B would overflow in [MIN,MAX] arithmetic.
203 Mathematically, % should never overflow, but on x86-like hosts
205 as an overflow too. */
209 /* Return 1 if A << B would overflow in [MIN,MAX] arithmetic.
269 -B == 0) suffices, but things get tricky if -B would overflow. */
278 /* Check for integer overflow, and report low order bits of answer.
281 might not yield numerically correct answers due to arithmetic overflow.
284 on undefined behavior due to signed arithmetic overflow.
289 printf ("result would overflow\n");
291 printf ("result is %ld (no overflow)\n", a * b);
296 bool overflow = INT_MULTIPLY_WRAPV (a, b, &result);
298 overflow ? "after overflow" : "no overflow");
315 A % B, and A << B would overflow, respectively. */
337 /* Return 1 if the expression A <op> B would overflow,
368 the operation. BUILTIN is the builtin operation, and OVERFLOW the
369 overflow predicate. Return 1 if the result overflows. See above
372 # define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) builtin (a, b, r) argument
374 # define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) \ argument
378 _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
381 _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
384 _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
387 _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
390 _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \
393 # define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) \ argument
395 ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
398 ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
401 ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
403 : _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow))
405 # define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \ argument
407 ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
409 : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \
412 # define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \ argument
413 _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
420 overflow problems. *R's type is T, with extrema TMIN and TMAX.
422 #define _GL_INT_OP_CALC(a, b, r, op, overflow, ut, t, tmin, tmax) \ argument
424 ? _GL_INT_OP_CALC1 ((t) (a), (t) (b), r, op, overflow, ut, t, tmin, tmax) \
425 : _GL_INT_OP_CALC1 (a, b, r, op, overflow, ut, t, tmin, tmax))
426 #define _GL_INT_OP_CALC1(a, b, r, op, overflow, ut, t, tmin, tmax) \ argument
427 ((overflow (a, b) \
435 behavior on signed integer overflow, and convert the result to type T.