# to the nth power

Doug Gwyn gwyn at smoke.brl.mil
Sun Nov 11 19:39:26 AEST 1990


In article <4239 at goanna.cs.rmit.oz.au> ok at goanna.cs.rmit.oz.au (Richard A. O'Keefe) writes:
>Does anyone know why C hasn't got a round() function and why ANSI
>failed to add one?

Because it is trivial to roll your own:
#define	Round( d )	floor( (d) + 0.5 )	/* requires <math.h> */
and because there was no established existing practice (e.g. the library
Base Document did not specify such a function).



More information about the Comp.lang.c mailing list