ReactOS 0.4.16-dev-959-g2ec3a19
imaxdiv.cpp File Reference
#include <inttypes.h>
Include dependency graph for imaxdiv.cpp:

Go to the source code of this file.

Functions

imaxdiv_t __cdecl imaxdiv (intmax_t const numerator, intmax_t const denominator)
 

Function Documentation

◆ imaxdiv()

imaxdiv_t __cdecl imaxdiv ( intmax_t const  numerator,
intmax_t const  denominator 
)

Definition at line 14 of file imaxdiv.cpp.

15{
17
18 result.quot = numerator / denominator;
19 result.rem = numerator - denominator * result.quot;
20
21 // Fix incorrect truncation:
22 #pragma warning(push)
23 #pragma warning(disable: 4127)
24 static bool const fix_required = (-1 / 2) < 0;
25 if (fix_required && result.quot < 0 && result.rem != 0)
26 {
27 result.quot += 1;
28 result.rem -= denominator;
29 }
30 #pragma warning(pop)
31
32 return result;
33}
GLuint64EXT * result
Definition: glext.h:11304