lib/libc/quad/moddi3.c
quad_t
__moddi3(quad_t a, quad_t b)
{
	u_quad_t ua, ub, ur;
	int neg;

	if (a < 0)
		ua = -(u_quad_t)a, neg = 1;
	else
		ua = a, neg = 0;
	if (b < 0)
		ub = -(u_quad_t)b;
	else
		ub = b;
	__qdivrem(ua, ub, &ur);
	return (neg ? -ur : ur);
}
/*
 * Return remainder after dividing two signed quads.
 *
 * XXX
 * If -1/2 should produce -1 on this machine, this code is wrong.
 */
Return remainder after dividing two signed quads.
XXX
If -1/2 should produce -1 on this machine, this code is wrong.
Return remainder after dividing two signed quads . XXX If - 1 / 2 should produce - 1 on this machine this code is wrong .
quad_t
__moddi3(quad_t a, quad_t b)
{
	u_quad_t ua, ub, ur;
	int neg;
	if (a < 0)
		ua = -(u_quad_t)a, neg = 1;
	else
		ua = a, neg = 0;
	if (b < 0)
		ub = -(u_quad_t)b;
	else
		ub = b;
	__qdivrem(ua, ub, &ur);
	return (neg ? -ur : ur);
}
quad_t __moddi3 ( quad_t a , quad_t b ) { u_quad_t ua , ub , ur ; int neg ; if ( a < 0 ) ua = - ( u_quad_t ) a , neg = 1 ; else ua = a , neg = 0 ; if ( b < 0 ) ub = - ( u_quad_t ) b ; else ub = b ; __qdivrem ( ua , ub , & ur ) ; return ( neg ? - ur : ur ) ; }
Return remainder after dividing two signed quads.
Return remainder after dividing two signed quads .