ldiv [C++ Reference]
Keywords: c,math,ldiv
Date: 2009-03-20T00:03:41-0700

[[ldiv]]
C++ Reference
Translations of this page?:

- en
- br-pt
- cn
- fr
- it
- jp
- pl
- ru
- tr

## 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

You can also use div() instead of ldiv() in C++, as it contains an overloaded version for it.

Related Topics: div

Edit this page • Old revisions
• • • Login • Index • Recent changes • RSS • cc •