Manpage of DIV

Google
Web www.fiveanddime.net

DIV

Section: NEWLIB (3)
Updated: 2005 Feb 23
Index Return to Main Contents
 

NAME

1.11 `div'--divide two integers

 

SYNOPSIS


     #include <stdlib.h>
     div_t div(int N, int D);  

DESCRIPTION

Divide N/D, returning quotient and remainder as two integers in a structure `div_t'.

 

RETURNS

The result is represented with the structure


      typedef struct
      {
       int quot;
       int rem;
      } div_t;


   where the `quot' field represents the quotient, and `rem' the remainder. For nonzero D, if ``R = div(N,D);'' then N equals ``R.rem + D*R.quot''.


   To divide `long' rather than `int' values, use the similar function `ldiv'.

 

PORTABILITY

`div' is ANSI.


   No supporting OS subroutines are required.

 

SEE ALSO

div is part of the libc library. The full documentation for libc is maintained as a Texinfo manual. If info and libc are properly installed at your site, the command
info libc

will give you access to the complete manual.


 

Index

NAME
SYNOPSIS
DESCRIPTION
RETURNS
PORTABILITY
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 21:25:16 GMT, May 16, 2005



www.fiveanddime.net








Google
Web www.fiveanddime.net