Charles.Forsyth20060303a828770d19 years agoHistory
26 lines · 290 B · C
RawDownload
#include <lib9.h>/* * floor and ceil-- greatest integer <= arg * (resp least >=) */ doublefloor(double d){	double fract; 	if(d < 0) {		fract = modf(-d, &d);		if(fract != 0.0)			d += 1;		d = -d;	} else		modf(d, &d);	return d;} doubleceil(double d){	return -floor(-d);}