[FFmpeg-devel] [PATCH] HE-AAC v1 decoder

Uoti Urpala uoti.urpala
Wed Jan 27 19:31:18 CET 2010


On Wed, 2010-01-27 at 18:41 +0100, Michael Niedermayer wrote:
> in practice just try cos(M_PI/3.0 + i*M_PI) though
> the input i surely is exactly representable also the output is ...

Of course you can break things if you add arbitrary intermediate
steps...


> > > the compiler can choose to keep values in registers that are more
> > > precisse than doubles or store as floats in intermediate memory loctions
> > > Code that depends on the rounding direction of 0.5 definitly is a
> > > time bomb.
> > 
> > Precision makes no difference here.
> 
> try:
> printf("%20.20f %20.20f\n", 0.4999999999999, (float)0.4999999999999);

That does not rely on the rounding direction of 0.5 (or any calculation
producing 0.5), but on the behavior of a different number. If you're
talking about calculations that lose precision in general then those are
unlikely to be reliable at any particular precision unless the code has
been carefully crafted for that.




More information about the ffmpeg-devel mailing list