Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!rutgers!ucsd!nosc!helios.ee.lbl.gov!lll-tis!lll-winken!uunet!mcvax!hp4nl!philmds!leo From: leo@philmds.UUCP (Leo de Wit) Newsgroups: comp.lang.c Subject: Re: sizes, bitfields, etc Message-ID: <584@philmds.UUCP> Date: 11 Aug 88 10:08:56 GMT References: <214@ISIDAPS5.UUCP> <9641@dartvax.Dartmouth.EDU> <62505@sun.uucp> <11794@steinmetz.ge.com> <12933@mimsy.UUCP> Reply-To: leo@philmds.UUCP (Leo de Wit) Organization: Philips I&E DTS Eindhoven Lines: 20 In article <12933@mimsy.UUCP> chris@mimsy.UUCP (Chris Torek) writes: [stuff deleted]... | ... { | bits a:(ROUNDUP(3,BITS_PER_BYTE)); | bits c:(ROUNDUP(11,BITS_PER_BYTE)); | ... | |where ROUNDUP is a compile-time expression that rounds its first |argument up to the nearest multiple of its second argument: | | /* nb. beware overflow in (x)+(y)-1 below */ | #define ROUNDUP(x, y) (floor(((x) + (y) - 1) / (y)) * (y)) Compile-time expression? This would imply that the compiler knows of floor() - which I doubt, because math.h declares floor as extern double floor(); furthermore the argument of floor should be double, and it looks like an integer expression. Any comments, Chris? Leo.