On Wed, May 23, 2007 at 04:57:08PM -0500, Jack O'Quin wrote:
> I know less about this than you do, Fons. But, I always seem to end up
> adding a rint() to statements like that. Not because I understand exactly
> what is going on, but because otherwise GCC gives me warning messages
> about casting float to int.
>
> What happens, if you change those lines like this?...
>
> y = (int) rint((x - a) * b + 0.5f);
Tried both floorf (x + 0.5f) which is my standard way of rounding
floats, and rint (x). Same results - the problem remains.
What is even more scary is this: adding a extra printf() _after_ all
the calculations and _after_ a number of other printf() that I have
been using to see what is happening is enough to remove the error -
it modifies the values printed by the previous printf()...
I'm now pretty sure this is the optimiser having an identity
crisis...
-- FA Follie! Follie! Delirio vano è questo ! _______________________________________________ Linux-audio-user mailing list Linux-audio-user@email-addr-hidden http://lists.linuxaudio.org/mailman/listinfo.cgi/linux-audio-userReceived on Thu May 24 04:15:02 2007
This archive was generated by hypermail 2.1.8 : Thu May 24 2007 - 04:15:02 EEST