You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
libowfat/mult/imult32.c

12 lines
202 B

#include "safemult.h"
int imult32(int32 a,int32 b,int32* c) {
int neg=(a<0);
19 years ago
uint32 d;
if (neg) a=-a;
if (b<0) { neg^=1; b=-b; }
19 years ago
if (umult32(a,b,&d)) return 0;
*c=(neg?-d:d);
return 1;
}