2 ** Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3 ** Distributed under the terms of the Haiku License.
12 imaxabs(intmax_t number
)
14 return number
> 0 ? number
: -number
;
19 imaxdiv(intmax_t numer
, intmax_t denom
)
23 result
.quot
= numer
/ denom
;
24 result
.rem
= numer
% denom
;
26 if (numer
>= 0 && result
.rem
< 0) {
36 strtoimax(const char *string
, char **_end
, int base
)
38 return (intmax_t)strtoll(string
, _end
, base
);
43 strtoumax(const char *string
, char **_end
, int base
)
45 return (intmax_t)strtoull(string
, _end
, base
);