Re: rounding to a multiple of x?
Re: rounding to a multiple of x?
- Subject: Re: rounding to a multiple of x?
- From: Steve Bird <email@hidden>
- Date: Wed, 19 May 2004 14:04:02 -0400
On May 19, 2004, at 11:47 AM, email@hidden wrote:
Greetings,
I can't seem to figure out how to roundup to a multiple of a number ie
if i have 1149 and i want to round up to a multiple of 4 how would
accomplish this? any direction would be great
1... integer divide by 4 (1149 / 4 = 287, remainder 1)
2.. To round UP to NEXT HIGHER multiple of four, add one (287 + 1 =
288) IFF remainder is not zero.
3... Multiply by 4 (288 * 4 = 1152)
----------------------------------------------------------------
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
www.Culverson.com (toll free) 1-877-676-8175
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.