lkml.org 
[lkml]   [1998]   [Aug]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: floating-point abuse in 2.1.113

Mikael Pettersson writes:

> - v.rangelow=(int)(87.9*16);
> - v.rangehigh=(int)(107.8*16);
> + v.rangelow=(879*16)/10;
> + v.rangehigh=(1078*16)/10;

How can that be a problem? Shouldn't the multiplication and cast
be evaluated at compile time, leaving only an int?

If gcc isn't doing that, is there a higher optimization level that
will perform the computation at compile time?

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html

\
 
 \ /
  Last update: 2005-03-22 13:43    [W:0.892 / U:0.340 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site