On Tue, 24 Jun 2014 08:50:01 +0200
"Roberto E. Vargas Caballero" <k...@shike2.com> wrote:

> I think a correct version may be:
> 
>       CEIL(x) ((int) (x) + ((x) > 0 ? 1.0 : 0.0))
> 

This is not quite right, given we want to return an int (according to
xw.ch, xw.cw and common sense (ceilf doesn't make sense)), it should
rather be:

CEIL(x) ((int) (x) + ((x) > 0 ? 1 : 0))

However, I favor Martti's verson, which is just plain genius:

CEIL(x) ((int)(x) + ((x) > 0))

Cheers

FRIGN

-- 
FRIGN <d...@frign.de>

Reply via email to