[Uml-devel] kdesdk/umbrello/umbrello

Jens Krüger jkrueger1 at users.sourceforge.net
Wed Mar 19 08:43:12 UTC 2003


Oh yes, its true 
but it is no problem to add the case of negative values

#define round(x) (x < 0 ? int(x - 0.5)  : int(x + 0.5))

It was only an idea to overcome the problem of rewriting the code if a 
function is missing.

Jens

Am Mittwoch, 19. März 2003 17:09 schrieb Dirk Mueller:
> On Mit, 19 Mär 2003, Jens Krüger wrote:
> > There exists a better way. Define a macro like the following dependend on
> > existence of a round function in the math lib.
> >
> > #define round(x) (int(x + 0.5))
>
> This macro does not work when x is negative.

-- 
Jens




More information about the umbrello-devel mailing list