7.8.2.2 The imaxdiv function

Synopsis

1

#include <inttypes.h>
imaxdiv_t imaxdiv(intmax_t numer, intmax_t denom);

Description

2

The imaxdiv function computes numer / denom and numer % denom in a single operation.

Returns

3

The imaxdiv function returns a structure of type imaxdiv_t comprising both the quotient and the remainder. The structure shall contain (in either order) the members quot (the quotient) and rem (the remainder), each of which has type intmax_t. If either part of the result cannot be represented, the behavior is undefined.