Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)

OSS Library Calls (i - m) lldiv(3)
NAME
lldiv - Divides long long integers
LIBRARY
G-series native Guardian processes: $SYSTEM.SYSnn.ZCRTLSRL
G-series native OSS processes: /G/system/sysnn/zcrtlsrl
H-series and J-series native Guardian processes: $SYSTEM.ZDLLnnn.ZCRTLDLL
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zcrtldll
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/ycrtldll
SYNOPSIS
#include <stdlib.h>
lldiv_t lldiv (
long long numerator,
long long denominator);
PARAMETERS
numerator Specifies a long long integer.
denominator Specifies a long long integer.
DESCRIPTION
The lldiv( ) function computes the quotient and remainder of the division of the numerator by the
denominator. If the division is inexact, the sign of the resulting quotient is that of the algebraic
quotient, and the magnitude of the resulting quotient is the largest integer less than the magnitude
of the algebraic quotient. If the result cannot be represented (for example, if the denominator is 0
[zero]), the behavior is undefined.
The lldiv( ) function performs the same function as the div( ) function, but accepts long long
integers rather than integers as parameters. The lldiv( ) function returns a structure of type
lldiv_t, comprising both the quotient and the remainder.
A two’s-complement integer can hold a negative number whose absolute value is too large for
the integer to hold.
RETURN VALUES
The lldiv( ) function returns a structure of type lldiv_t. The struct returned contains members
named quot and rem; their type is the same as the type of the parameters.
RELATED INFORMATION
Functions: div(3), oor(3), ldiv(3).
527187-017 Hewlett-Packard Company 4101