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

◆ sub_from() [2/2]

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

Definition at line 158 of file overflow.hpp.

159{
160 int32_t z = (uint32_t)x - (uint32_t)y;
161 if
162 expect_false((int32_t)((uint32_t)x ^ (uint32_t)z) < 0 &&
163 (int32_t)((uint32_t)x ^ (uint32_t)y) < 0) ov(msg);
164 return x = z;
165}
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 sub_from().