*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> div (3c)              
Title
Content
Arch
Section
 

Contents


DIV(3C)								       DIV(3C)


NAME    [Toc]    [Back]

     div, ldiv - perform integer division

SYNOPSIS    [Toc]    [Back]

     #include <stdlib.h>

     div_t div (int numer, int denom);

     ldiv_t ldiv (long int numer, long int denom);

DESCRIPTION    [Toc]    [Back]

     div and ldiv compute the quotient and remainder resulting from the
     division of the integer dividend numer by the integer divisor denom.  If
     the division is inexact, the quotient will	be the nearest integer with
     less magnitude than the algebraic quotient	(e.g., div(5/2)	yields 2, and
     div(-5/2) yields -2).

     div operates on and returns int quantities. ldiv operates on and returns
     long int quantities.

     Unless the	result cannot be represented, div and ldiv return the result
     in	a structure (div_t for div, ldiv_t for ldiv) which has two integer
     members: the quotient, quot, and the remainder, rem.  These members are
     of	type int for div, and long int for ldiv.

DIAGNOSTICS    [Toc]    [Back]

     If	div or ldiv is invoked with a zero denom, the same integer divide-byzero
 trap occurs as if the	integer	division had occurred in-line.


									PPPPaaaaggggeeee 1111
[ Back ]
 Similar pages
Name OS Title
div Linux computes the quotient and remainder of integer division
ldiv Linux computes the quotient and remainder of long integer division.
m_out Tru64 Perform multiple precision integer arithmetic
madd Tru64 Perform multiple precision integer arithmetic
itom Tru64 Perform multiple precision integer arithmetic
invert Tru64 Perform multiple precision integer arithmetic
mout Tru64 Perform multiple precision integer arithmetic
gcd Tru64 Perform multiple precision integer arithmetic
fmout Tru64 Perform multiple precision integer arithmetic
fmin Tru64 Perform multiple precision integer arithmetic
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service