]> pd.if.org Git - pdclib/blob - functions/stdlib/ldiv.c
Initial checkin.
[pdclib] / functions / stdlib / ldiv.c
1 /* $Id$ */
2
3 /* Release $Name$ */
4
5 /* ldiv( int, int )
6
7    This file is part of the Public Domain C Library (PDCLib).
8    Permission is granted to use, modify, and / or redistribute at will.
9 */
10
11 #include <stdlib.h>
12
13 #ifndef REGTEST
14
15 ldiv_t ldiv( long int numer, long int denom )
16 {
17     ldiv_t rc;
18     rc.quot = numer / denom;
19     rc.rem  = numer % denom;
20     /* TODO: pre-C99 compilers might require modulus correction */
21     return rc;
22 }
23
24 #endif
25
26 #ifdef TEST
27 #include <_PDCLIB_test.h>
28
29 int main()
30 {
31     int NO_TESTDRIVER = 0;
32     BEGIN_TESTS;
33     TESTCASE( NO_TESTDRIVER );
34     return TEST_RESULTS;
35 }
36
37 #endif