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.

25 lines
361 B

#include <stdlib.h>
/*
* Ok, there are probably buggy: sign etc. Linus
*/
div_t div(int num, int denom)
{
div_t res;
__asm__("idivl %3":"=a" (res.quot),"=d" (res.rem)
:"0" (num),"g" (denom));
return res;
}
ldiv_t ldiv(long num, long denom)
{
ldiv_t res;
__asm__("idivl %3":"=a" (res.quot),"=d" (res.rem)
:"0" (num),"g" (denom));
return res;
}