home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
alib
/
d2xx
/
d222
/
plplot.lha
/
Plplot
/
src
/
source.zoo
/
round.c
< prev
next >
Wrap
C/C++ Source or Header
|
1989-05-15
|
333b
|
19 lines
/* round rounds a floating point value to an integer value. */
#include "plplot.h"
#include <math.h>
int round(flt)
float flt;
{
double mant, frac;
frac = modf(flt,&mant);
if( fabs(frac) < .5 )
return((int)mant);
else if (frac > 0)
return((int)(++mant));
else
return((int)(--mant));
}