< C++ Programming < Code < Standard C Library < Functions

ldiv

Syntax
#include <cstdlib>
ldiv_t ldiv( long numerator, long denominator );

Testing: adiv_t, div_t, ldiv_t.

The ldiv() function returns the quotient and remainder of the operation numerator / denominator. The ldiv_t structure is defined in cstdlib and has at least:

long quot;  // the quotient
long rem;   // the remainder
Related topics
div
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.