[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4ED3839E.6080702@grupopie.com>
Date: Mon, 28 Nov 2011 12:50:38 +0000
From: Paulo Marques <pmarques@...popie.com>
To: Nuno Santos <nsantos@...gma.com>
CC: linux-kernel@...r.kernel.org
Subject: Re: Floating point usage inside kernel
Nuno Santos wrote:
> Ok, understood!
>
> Just one more question. To do this, do I need to change the data type
> from double to int?
You shouldn't have any "double" declarations on kernel code or the
compiler might start using floating point instructions to handle it.
Things that the compiler can work out at compile time are probably ok,
like converting constants:
#define FIXED(a) (s32)((a) * 65536.0)
fixed = FIXED(1.25);
In this case compiler should make all the calculations at compile time
and replace the macro "FIXED(1.25)" with the integer 81920.
--
Paulo Marques - www.grupopie.com
"Don't worry, you'll be fine; I saw it work in a cartoon once..."
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists