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

◆ add() [2/2]

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

Definition at line 116 of file overflow.hpp.

117{
118 int32_t z = (uint32_t)x + (uint32_t)y;
119 if
120 expect_false((int32_t)((uint32_t)x ^ (uint32_t)z) < 0 &&
121 (int32_t)((uint32_t)x ^ (uint32_t)y) >= 0) ov(msg);
122 return z;
123}
return(void *) result
void ov(const char *msg)
Definition overflow.cpp:5
volatile int x
#define expect_false(x)
Definition overflow.hpp:66

References expect_false, ov(), and x.

Referenced by add(), main(), monomialOrderEncodeFromActualExponents(), ExponentList< int, true >::mult(), ExponentVector< int, true >::mult(), Monoid::mult(), ExponentVector< int, true >::multpower(), ExponentVector< int, true >::simple_degree(), and ExponentVector< int, true >::weight().