ReactOS  0.4.15-dev-494-g1d8c567
div.c
Go to the documentation of this file.
1 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
2 #include <precomp.h>
3 
4 /*
5  * @implemented
6  */
7 div_t
8 CDECL
9 div(int num, int denom)
10 {
11  div_t r;
12 
13  if (num > 0 && denom < 0) {
14  num = -num;
15  denom = -denom;
16  }
17  r.quot = num / denom;
18  r.rem = num % denom;
19  if (num < 0 && denom > 0)
20  {
21  if (r.rem > 0)
22  {
23  r.quot++;
24  r.rem -= denom;
25  }
26  }
27  return r;
28 }
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
div_t CDECL div(int num, int denom)
Definition: div.c:9
GLuint GLuint num
Definition: glext.h:9618
Definition: stdlib.h:50
#define CDECL
Definition: compat.h:21