EasyManuals Logo
Home>Texas Instruments>Computer Hardware>TMS34010

Texas Instruments TMS34010 Reference Guide

Texas Instruments TMS34010
181 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #109 background imageLoading...
Page #109 background image
div/ldiv
Syntax
#include
<stdlib.h>
div_t
div(numer,
denom)
int
numer,
denom;
ldiv_t
ldiv(numer,
denom)
long
int
numer,
denom;
Division
Defined
in
div.
c in
rts.
src
Description
Two
functions support integer division by returning
numer
divided by
de-
nom. You can use these functions
to
get both the quotient and the re-
mainder in a single operation.
6-34
The
div
function performs integer division. The input arguments
are
integers; the function returns the quotient and the remainder in a
structure
of
type
div-t.
The structure
is
defined
as
follows:
typedef
struct
{
int
quot;
int
rem;
div_t;
/*
quotient
*/
/*
remainder
*/
The
Idiv
function performs long integer division. The input argu-
ments
are
long integers; the function returns the quotient and the re-
mainder in a structure
of
type
Idiv-t.
The structure
is
defined
as
follows:
typedef
struct
{
long
int
quot;
long
int
rem;
ldiv-ti
/*
quotient
*/
/*
remainder
*/
If
the division produces a remainder, then the sign
of
the quotient
is
the
same
as
the algebraic quotient, and the magnitude
of
the resulting quotient
is
the largest integer
less
than the magnitude
of
the algebraic quotient.
Since ints and longs
are
equivalent types in TMS3401 0
C,
these functions
are
also equivalent
..

Table of Contents

Other manuals for Texas Instruments TMS34010

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments TMS34010 and is the answer not in the manual?

Texas Instruments TMS34010 Specifications

General IconGeneral
BrandTexas Instruments
ModelTMS34010
CategoryComputer Hardware
LanguageEnglish

Related product manuals