ReactOS  0.4.14-dev-552-g2fad488
div.c File Reference
#include <precomp.h>
Include dependency graph for div.c:

Go to the source code of this file.

Functions

div_t CDECL div (int num, int denom)
 

Function Documentation

◆ div()

div_t CDECL div ( int  num,
int  denom 
)

Definition at line 9 of file div.c.

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
GLuint GLuint num
Definition: glext.h:9618
Definition: stdlib.h:50