#include "ft_math.h"
#include <limits.h>
#include <stdint.h>
Go to the source code of this file.
◆ can_add()
| bool can_add |
( |
int |
a, |
|
|
int |
b |
|
) |
| |
Definition at line 18 of file can_add.c.
20 if ((a <= 0 && 0 <= b) || (b <= 0 && 0 <= a))
23 return (b <= (INT_MAX - a));
25 return ((INT_MIN - a) <= b);
◆ can_addl()
| bool can_addl |
( |
long |
a, |
|
|
long |
b |
|
) |
| |
Definition at line 33 of file can_add.c.
35 if ((a <= 0 && 0 <= b) || (b <= 0 && 0 <= a))
38 return (b <= (LONG_MAX - a));
40 return ((LONG_MIN - a) <= b);
◆ can_addp()
| bool can_addp |
( |
size_t |
a, |
|
|
size_t |
b |
|
) |
| |
Definition at line 43 of file can_add.c.
45 return (b <= (UINTPTR_MAX - a));
◆ can_addu()
| bool can_addu |
( |
unsigned int |
a, |
|
|
unsigned int |
b |
|
) |
| |
Definition at line 28 of file can_add.c.
30 return (b <= (UINT_MAX - a));