bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gnulib] Re: base64


From: Stepan Kasal
Subject: Re: [bug-gnulib] Re: base64
Date: Thu, 25 Nov 2004 15:55:02 +0100
User-agent: Mutt/1.4.1i

Hi,

On Thu, Nov 25, 2004 at 03:37:06PM +0100, Simon Josefsson wrote:
> >     #define _BASE64_CEILING_DIV(n, k) ((n + (k-1)) / k)
> >     #define BASE64_LENGTH(inlen) (_BASE64_CEILING_DIV(inlen, 3) * 4)

first, we were both wrong, we have to parenthesize the parameter:

     #define _BASE64_CEILING_DIV(n, k) ((n + (k-1)) / k)
     #define BASE64_LENGTH(inlen) (_BASE64_CEILING_DIV((inlen), 3) * 4)

> What advantage does this have over
> 
> #define BASE64_LENGTH(inlen) ((((inlen) + 2) / 3) * 4)
> 
> The latter seems simpler to me.

I meant to show the structure of the formula.  Never mind.
Let's accept your version.

Stepan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]