Embedded Artistry libc
C Standard Library Support for Bare-metal Systems
|
#include <stdlib.h>
Go to the source code of this file.
Functions | |
ldiv_t | ldiv (long num, long denom) |
Computes both the quotient and the remainder of the division of the numerator x by the denominator y. More... | |
ldiv_t ldiv | ( | long | x, |
long | y | ||
) |
Computes both the quotient and the remainder of the division of the numerator x by the denominator y.
Computes both the quotient and the remainder of the division of the numerator x by the denominator y. Computes quotient and remainder simultaneously. The quotient is the algebraic quotient with any fractional part discarded (truncated towards zero). The remainder is such that quot * y + rem == x.
Computes the quotient (the result of the expression x/y) and remainder (the result of the expression xy) simultaneously.
x | integer values |
y | integer values |
If either the remainder or the quotient cannot be represented, the behavior is undefined.
Definition at line 35 of file ldiv.c.
References ldiv_t::quot, and ldiv_t::rem.