libowfat/mult/imult32.c

12 lines
202 B
C
Raw Normal View History

#include "safemult.h"
int imult32(int32 a,int32 b,int32* c) {
int neg=(a<0);
2004-01-06 23:35:06 +00:00
uint32 d;
if (neg) a=-a;
if (b<0) { neg^=1; b=-b; }
2004-01-06 23:35:06 +00:00
if (umult32(a,b,&d)) return 0;
*c=(neg?-d:d);
return 1;
}