libroot/posix/stdio: Remove unused portions.
[haiku.git] / src / system / libroot / posix / inttypes.c
blob2bcc0186b12093868199654d73dec1182b87ee8b
1 /*
2 ** Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3 ** Distributed under the terms of the Haiku License.
4 */
7 #include <inttypes.h>
8 #include <stdlib.h>
11 intmax_t
12 imaxabs(intmax_t number)
14 return number > 0 ? number : -number;
18 imaxdiv_t
19 imaxdiv(intmax_t numer, intmax_t denom)
21 imaxdiv_t result;
23 result.quot = numer / denom;
24 result.rem = numer % denom;
26 if (numer >= 0 && result.rem < 0) {
27 result.quot++;
28 result.rem -= denom;
31 return result;
35 intmax_t
36 strtoimax(const char *string, char **_end, int base)
38 return (intmax_t)strtoll(string, _end, base);
42 uintmax_t
43 strtoumax(const char *string, char **_end, int base)
45 return (intmax_t)strtoull(string, _end, base);