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

◆ sub() [2/2]

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

Definition at line 144 of file overflow.hpp.

145{
146 int32_t z = (uint32_t)x - (uint32_t)y;
147 if
148 expect_false((int32_t)((uint32_t)x ^ (uint32_t)z) < 0 &&
149 (int32_t)((uint32_t)x ^ (uint32_t)y) < 0) ov(msg);
150 return z;
151}
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 ExponentVector< int, true >::divide(), main(), monomialOrderDecodeToActualExponents(), and sub().