Re: Floating point in kernel

From: David Wragg (dpw@doc.ic.ac.uk)
Date: Thu May 04 2000 - 15:36:03 EST


"Richard B. Johnson" <root@chaos.analogic.com> writes:
> Correct. In the cited case, the code could read:
>
> foo = some_other_ulong * 1234 / 1000;
>
> The complier sometimes optimizes the wrong stuff so 1234/1000 might
> get optimized to 1 which is not what you want.

If the compiler does that, it isn't a C compiler. Even K&R was clear
on this, and the grammars in C90 and C99 require left-to-right
associativity for "*" and "/".

David Wragg

-
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.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun May 07 2000 - 21:00:15 EST