[algogeeks] Re: macro

2011-09-06 Thread Dave
@Mohit: If n is a power of 2, then the macro returns x if x is a multiple of n or x rounded up to the next multiple of n if x is not a multiple of n. E.g., ROUNDUP(16,4) = 16 and ROUNDUP(17,4) = 20. The result doesn't appear useful if n is not a power of 2. Since ~(n-1) = -n, it could be written

Re: [algogeeks] Re: macro

2011-09-06 Thread Sandy
What is the practical application of this expression? On Tue, Sep 6, 2011 at 5:38 PM, Dave dave_and_da...@juno.com wrote: @Mohit: If n is a power of 2, then the macro returns x if x is a multiple of n or x rounded up to the next multiple of n if x is not a multiple of n. E.g., ROUNDUP(16,4) =

[algogeeks] Re: macro

2011-09-06 Thread Dave
@Sandy: You could use this when you need to round up a number to a number that has a certain number of low-order zeros. As far as a practical application: when you need it you need it. Dave On Sep 6, 10:31 am, Sandy sandy.wad...@gmail.com wrote: What is the practical application of this