>
> 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?
The problem is the "." in 88.9, etc. This means "float". It should
be something like 889/10, but you don't want to do the division
immediately. The stuff with the "+" is the correct way. It will
be evaluated at compile time to be 1406 for the 87.9 range.
Cheers,
Dick Johnson
***** FILE SYSTEM MODIFIED *****
Penguin : Linux version 2.1.113 on an i586 machine (66.15 BogoMips).
Warning : It's hard to remain at the trailing edge of technology.
-
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