home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 September
/
Simtel20_Sept92.cdr
/
msdos
/
c
/
cc02.arc
/
FLOOR.C
< prev
next >
Wrap
Text File
|
1986-01-03
|
640b
|
30 lines
/***********************************************************
* The TULSA IBM C BOARD *
* 918-664-8737 *
* 300/1200 XMODEM, 24 Hours *
**********************************************************/
#include "math.h"
double floor(d)
double d;
{
if (d < 0.0)
return -ceil(-d);
modf(d, &d);
return d;
}
double ceil(d)
double d;
{
if (d < 0.0)
return -floor(-d);
if (modf(d, &d) > 0.0)
++d;
return d;
}