----------------------------------------------------------- New Message on BDOTNET
----------------------------------------------------------- From: KGK Message 2 in Discussion Hi! If you want the closest multiple of 4, either of the left or right sides of 4, then your macro will not give the correct result. Say, x = 9. Then: X&3 = 1 CEIL4(X) = X+4 - (X&3) = 9+4-1 = 12 which is wrong since the closest multiple will be 8. 12 is the next closest multiple. Here's how to get the closest multiple of 4 from either side of a given number: #define CEIL4(X) ((X&3)<2:(X-(X&3)):(X+(4-(X&3)))) Ofcourse, this macro assumes that if a mid number is specified (eg, 10 is mid of 8 and 12), then it will return the next closest multiple of 4, i.e.,12. Regards, Gaurav ----------------------------------------------------------- To stop getting this e-mail, or change how often it arrives, go to your E-mail Settings. http://groups.msn.com/bdotnet/_emailsettings.msnw Need help? If you've forgotten your password, please go to Passport Member Services. http://groups.msn.com/_passportredir.msnw?ppmprop=help For other questions or feedback, go to our Contact Us page. http://groups.msn.com/contact If you do not want to receive future e-mail from this MSN group, or if you received this message by mistake, please click the "Remove" link below. On the pre-addressed e-mail message that opens, simply click "Send". Your e-mail address will be deleted from this group's mailing list. mailto:[EMAIL PROTECTED]
