[comp.lang.c] Constant expression to round down to power of 2 desired

blarson@castor.usc.edu (Bob Larson) (03/23/87)

Does anyone have an expression that can be computed at compile time to
round a constant down to a power of 2?  (Conversions from round-up and
the boundary case are trivial.)

I'm currently using a run-time iterative solution, but I'll probably
convert it to nested ?: operations before the code is released.

Please reply directly to me, I'll summarize if there is interest.
-- 
Bob Larson
Arpa: Blarson@Usc-Eclb.Arpa
Uucp: (several backbone sites)!sdcrdcf!usc-oberon!castor.usc.edu!blarson
			seismo!cit-vax!usc-oberon!castor.usc.edu!blarson