[Ffmpeg-cvslog] r8474 - trunk/libavcodec/resample2.c
Rich Felker
dalias
Thu Mar 22 21:13:51 CET 2007
On Thu, Mar 22, 2007 at 09:14:53PM +0200, Uoti Urpala wrote:
> On Thu, 2007-03-22 at 12:33 -0500, Rich Felker wrote:
> > On Thu, Mar 22, 2007 at 06:39:16PM +0200, Uoti Urpala wrote:
> > > That's because you used floats but gcc kept the variables in FPU
> > > registers. Try it with long doubles or use -ffloat-store.
> >
> > Won't help. All floating point expressions are actually double or
> > larger in C. You'll need to explicitly cast to (float) after the
> > multiplications to avoid it.
>
> Not true. The type of float*float is float. gcc does generate inf as the
> result of FLT_MAX*FLT_MAX on x86 too if you use -ffloat-store (the
> standard does allow the gcc default of using more precision/range than
> required by the type of the result - of course the standard allows
> pretty much anything for floating point).
Yes, indeed it allows the result of all float expressions to be 0.0
even... (Assume IEEE floating point if you want to have any reasonable
predictable behavior.) However, you should look at FLT_EVAL_METHOD in
math.h. This constant, along with float_t and double_t, indicate how
floating point expressions are evaluated.
Regardless, my original point to Michael stands modulo technicalities.
Rich
More information about the ffmpeg-cvslog
mailing list