Guardian Native C Library Calls Reference Manual (G06.25+, H06.03+)

Guardian Native C Library Calls (a - e) div(3)
NAME
div - Divides integers
LIBRARY
G-series native Guardian processes: $SYSTEM.SYSnn.ZCRTLSRL
G-series native OSS processes: /G/system/sysnn/zcrtlsrl
H-series native Guardian processes: $SYSTEM.ZDLLnnn.ZCRTLDLL
H-series OSS processes: /G/system/zdllnnn/zcrtldll
SYNOPSIS
#include <stdlib.h>
struct div_t div(
int numerator,
int denominator);
PARAMETERS
numerator Species an integer.
denominator Species an integer.
DESCRIPTION
The div( ) 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), the behavior is undened. The div( ) function returns a structure of type div_t, comprising
both the quotient and the remainder.
Atwos-complement integer can hold a negative number whose absolute value is too large for
the integer to hold.
RETURN VALUES
The div( ) function returns a structure of type div_t.
RELATED INFORMATION
Functions: ldiv(3), oor(3).
527192-003 Hewlett-Packard Company 147