Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- libc - <b>lldiv</b> http://www.ousob.com [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
lldiv
=====

Syntax
------

     #include <stdlib.h>
     
     lldiv_t lldiv(long long numerator, long long denomonator);

Description
-----------

Returns the quotient and remainder of the division NUMBERATOR divided
by DENOMONATOR.  The return type is as follows:

     typedef struct {
       long long quot;
       long long rem;
     } lldiv_t;

Return Value
------------

The results of the division are returned.

Example
-------

     lldiv_t l = lldiv(42, 3);
     printf("42 = %lld x 3 + %lld\n", l.quot, l.rem);
     
     lldiv(+40, +3) = { +13, +1 }
     lldiv(+40, -3) = { -13, -1 }
     lldiv(-40, +3) = { -13, -1 }
     lldiv(-40, -3) = { +13, -1 }


Online resources provided by: http://www.ousob.com --- NG 2 HTML conversion by Dave Pearson