div.c 370 B

1234567891011121314151617
  1. /* vi: set sw=4 ts=4: */
  2. /*
  3. * div for uClibc
  4. * Copyright (C) 2000-2006 by Erik Andersen <andersen@uclibc.org>
  5. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  6. */
  7. #include <stdlib.h>
  8. div_t div(int numer, int denom)
  9. {
  10. div_t result;
  11. result.quot = numer / denom;
  12. result.rem = numer - (result.quot * denom);
  13. return(result);
  14. }