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

◆ pos_add_2() [2/2]

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

Definition at line 209 of file overflow.hpp.

210{
211 assert(!over_2(x) && !over_2(y));
212 int32_t z = (uint32_t)x + (uint32_t)y;
213 if
214 expect_false(over_2(z)) ov(msg);
215 return z;
216}
static int32_t over_2(int32_t x)
Definition overflow.hpp:107
void ov(const char *msg)
Definition overflow.cpp:5
volatile int x
#define expect_false(x)
Definition overflow.hpp:66

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

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