Macaulay2 Engine
Loading...
Searching...
No Matches

◆ pos_add() [2/2]

int32_t safe::pos_add ( int32_t x,
int32_t y,
const char * msg )
inlinestatic

Definition at line 197 of file overflow.hpp.

198{
199 assert(!over_1(x) && !over_1(y));
200 int32_t z = (uint32_t)x + (uint32_t)y;
201 if
202 expect_false(over_1(z)) ov(msg);
203 return z;
204}
void ov(const char *msg)
Definition overflow.cpp:5
static int32_t over_1(int32_t x)
Definition overflow.hpp:106
volatile int x
#define expect_false(x)
Definition overflow.hpp:66

References expect_false, ov(), over_1(), and x.

Referenced by Monoid::mult(), and pos_add().