|
Graphviz 16.1.1~dev.20261017.1520
|
arithmetic overflow helpers More...
#include <assert.h>#include <limits.h>#include <math.h>#include <stdbool.h>#include <stddef.h>#include <stdint.h>Go to the source code of this file.
Functions | |
| static bool | sadd_overflow (int a, int b, int *res) |
| static int | sadd_saturate (int a, int b) |
| static bool | size_overflow (size_t a, size_t b, size_t *res) |
| static bool | u64add_overflow (uint64_t a, uint64_t b, uint64_t *res) |
| static bool | u64mul_overflow (uint64_t a, uint64_t b, uint64_t *res) |
| static bool | fdiv_overflow (double n, double d, double *res) |
| static bool | fdivf_overflow (float n, float d, float *res) |
Replace this with stdckdint.h when moving to C23.
Definition in file overflow.h.
|
inlinestatic |
divide two double floating-point values, checking for overflow
| n | Division numerator |
| d | Division denominator |
| res | [out] Result on success |
Definition at line 142 of file overflow.h.
References NULL.
Referenced by bend(), and poly_inside().
|
inlinestatic |
divide two floating-point values, checking for overflow
| n | Division numerator |
| d | Division denominator |
| res | [out] Result on success |
Definition at line 162 of file overflow.h.
References NULL.
|
inlinestatic |
add two integers, checking for overflow
| a | Operand 1 |
| b | Operand 2 |
| res | [out] Result on success |
Definition at line 23 of file overflow.h.
References NULL.
Referenced by x_cutval().
|
inlinestatic |
add two integers, clamping to lower and upper type bounds
| a | Operand 1 |
| b | Operand 2 |
a + b, or INT_MAX/INT_MIN on overflow/underflow Definition at line 49 of file overflow.h.
Referenced by tree_adjust().
|
inlinestatic |
add two sizes, checking for overflow
| a | Operand 1 |
| b | Operand 2 |
| res | [out] Result on success |
Definition at line 70 of file overflow.h.
References NULL, and SIZE_MAX.
Referenced by SparseMatrix_multiply(), and SparseMatrix_multiply3().
|
inlinestatic |
add two 64-bit unsigned integers, checking for overflow
| a | Operand 1 |
| b | Operand 2 |
| res | [out] Result on success |
Definition at line 94 of file overflow.h.
References NULL.
Referenced by uadd().
|
inlinestatic |
multiply two 64-bit unsigned integers, checking for overflow
| a | Operand 1 |
| b | Operand 2 |
| res | [out] Result on success |
Definition at line 118 of file overflow.h.
References NULL.
Referenced by umul().