[Ffmpeg-cvslog] r8474 - trunk/libavcodec/resample2.c

Rich Felker dalias
Thu Mar 22 18:32:29 CET 2007


On Thu, Mar 22, 2007 at 05:20:17PM +0100, Michael Niedermayer wrote:
> Hi
> 
> On Thu, Mar 22, 2007 at 10:18:04AM -0500, Rich Felker wrote:
> > On Thu, Mar 22, 2007 at 11:47:01AM +0100, Michael Niedermayer wrote:
> > > to factor out the pow() your needing algebraic identities depends on how pow
> > > is defined either way the associative law for multiplication is enough and
> > 
> > Associative law is false with floats. Think of
> > 
> > A = FLOAT_MAX
> > B = FLOAT_MAX
> > C = 1.0/FLOAT_MAX
> 
> yes i did think of it, and i just tested:
> [...]

This was not intended as C code, just as abstract explanation. In C,
all floating point expressions are evaulated as doubles or larger. You
need DBL_MAX or whatever for it to work. The results will be:

(A*B)*C = +Inf
A*(B*C) = A

Rich




More information about the ffmpeg-cvslog mailing list