home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fish 'n' More 1
/
FishNMoreVol1.bin
/
more
/
code_examples
/
librar
/
dround.c
< prev
next >
Wrap
Text File
|
1989-02-08
|
660b
|
29 lines
/*--------------------------------------*/
/* */
/* DROUND(X,X) */
/* */
/* Rounds a floating point number. The */
/* first argument is the number to be */
/* rounded. The second argument is the */
/* decimal precision to be rounded to. */
/* */
/*--------------------------------------*/
double dround(floter,b)
int b;
double floter;
{
float ff;
double ii,iii,pow(),h,hh;
long a,d;
a=floter;
ii=floter-a;
h=10;
hh=b;
hh=pow(h,hh);
ff=ii=ii*hh;
d=round(ff);
ii=1/hh;
iii=a+(d*ii);
return(iii);
}