1 /** 2 * This file has no copyright assigned and is placed in the Public Domain. 3 * This file is part of the mingw-w64 runtime package. 4 * No warranty is given; refer to the file DISCLAIMER.PD within this package. 5 */ 6 /* 7 This source code was extracted from the Q8 package created and 8 placed in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil> 9 last edit: 1999/11/05 gwyn@arl.mil 10 11 12 last edit: 1999/11/05 gwyn@arl.mil 13 14 Implements subclause 7.8.2 of ISO/IEC 9899:1999 (E). 15 16 */ 17 18 #include <inttypes.h> 19 #include <stdlib.h> 20 21 imaxdiv_t imaxdiv(intmax_t numer,intmax_t denom)22imaxdiv(intmax_t numer, intmax_t denom) 23 { 24 imaxdiv_t result; 25 result.quot = numer / denom; 26 result.rem = numer % denom; 27 return result; 28 } 29 30 lldiv_t __attribute__ ((alias ("imaxdiv"))) 31 lldiv (long long, long long); 32