Trouble with floor ()
Robert Zeff
robert at csustan.UUCP
Sun Jun 12 05:34:54 AEST 1988
I'm having trouble with ceil () & floor ().
This program returns the correct values on the first loop only.
On successive passes, floor() returns the same result as ceil().
I'm using a Tektronix 4301 (68020, UTEK & BSD4.3,
GreenHills C compiler.)
#include <math.h>
main () {
double value, ceil (), floor ();
for (;;) {
printf ("\nInput value: ");
scanf ("%lf", &value);
printf ("\nCeiling: %lf, Floor: %lf\n", ceil (value), floor (value));
}
}
Anyone else having this problem on other hardware?
thanks,
--
Robert Zeff (209) 577-4268 voice, FAX: (209) 577-8548
2549 Yosemite Blvd Ste. E {lll-lcc,lll-crg}!csustan!zhome!robert
Modesto, Ca. 95354 {lll-lcc,lll-crg}!csustan!robert
More information about the Comp.lang.c
mailing list