Re: [dev] [st] [PATCH] Explicit cast in CEIL macro

From: Martti Kühne <mysatyre_AT_gmail.com>
Date: Tue, 24 Jun 2014 17:22:06 +0200

>
> True.
> Hence, and following other sources about this topic [0], I suggest
>
> #define CEIL(x) ((int)(x) + ((int)(x) > 0) * ((x - (int)(x)) > FLT_EPSILON))
>

On another note, I'd even use && instead of * there, but that would
require another pair of parentheses.
Received on Tue Jun 24 2014 - 17:22:06 CEST

This archive was generated by hypermail 2.3.0 : Tue Jun 24 2014 - 17:24:19 CEST