C Language and Libraries Help (clang.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
div, ldiv
 Summary Example                         Up Contents Index Back
─────Run-Time Library───────────────────────────────────────────────────────
 
     The div and ldiv functions divide <numer> by <denom>, computing
     the quotient and the remainder. The arguments for the div function
     are integers, and the arguments for the ldiv function are long
     integers.
 
     The sign of the quotient is the same as that of the mathematical
     quotient. Its absolute value is the largest integer that is less
     than the absolute value of the mathematical quotient. If the
     denominator is 0, the program terminates with an error message.
 
     Return Value
 
     The div function returns a structure of type div_t, comprising
     both the quotient and the remainder. The ldiv function returns a
     structure of type ldiv_t. These structures are defined in
     STDLIB.H.
                                    -♦-