sizes, bitfields, etc

Chris Torek chris at mimsy.UUCP
Sat Aug 13 08:44:57 AEST 1988


>In article <12933 at mimsy.UUCP> I wrote
>>where ROUNDUP is a compile-time expression ...
>>	#define ROUNDUP(x, y)  (floor(((x) + (y) - 1) / (y)) * (y))

In article <584 at philmds.UUCP> leo at philmds.UUCP (Leo de Wit) writes:
>Compile-time expression? This would imply that the compiler knows of floor()

Oops.  I originally wrote

	ROUNDUP a b: floor( ... )

or something equally un-C-like (since this was intended not to be a
C-centric argument), and I put in the floor() to indicate that the
division should not be doing in rational or fixed- or floating-point
arithmetic.  I then decided that this would be overly confusing and
switched to the C syntax, without removing the floor() or adding any
explanation.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris at mimsy.umd.edu	Path:	uunet!mimsy!chris



More information about the Comp.lang.c mailing list