[MPlayer-dev-eng] Patch for gcc 3.4 against MPlayer-1.0pre5

D Richard Felker III dalias at aerifal.cx
Thu Sep 2 17:42:04 CEST 2004


On Thu, Sep 02, 2004 at 05:25:31PM +0200, Torinthiel wrote:
> On Thu, Sep 02, 2004 at 10:23:04AM -0400, D Richard Felker III wrote:
> > 
> > On Thu, Sep 02, 2004 at 03:29:07PM +0200, Torinthiel wrote:
> > > On Thu, Sep 02, 2004 at 02:06:01PM +0200, Michael Niedermayer wrote:
> > > > from 'info libc'
> > > > ----
> > > > Round to nearest.
> > > >      This is the default mode.  It should be used unless there is a
> > > >      specific need for one of the others.  In this mode results are
> > > >      rounded to the nearest representable value.  If the result is
> > > >      midway between two representable values, the even representable is
> > > >      chosen. "Even" here means the lowest-order bit is zero.  This
> > > >      rounding mode prevents statistical bias and guarantees numeric
> > > >      stability: round-off errors in a lengthy calculation will remain
> > > >      smaller than half of `FLT_EPSILON'.
> > > 
> > > Now this is more specific. But also quite strange. I don't want to argue
> > > against specs, but AFAIK numbers are coded as sign*0.1(mantissa)*pow(2,exp)
> > 
> > 0.1?!? wtf? 0.1 is not even representible as a float, it takes
> > infinitely many places in binary...
> > 
> > > where sign, mantissa and exp are stored in memory and fraction is
> > > a binary one, not decimal. (mantissa binary, exp decimal)
> 
> How about reading till end? I said the fraction is BINARY.
> 
> > > So, 1.5 (mantissa 1, exponent 1) would round to 1 (mantissa 0, exp 1)
> > > but 3.5 (mantissa 11, exponent 2) would round to 4 (mantissa 0, exp 3).
> > > Or am I wrong somewhere? This is some random rounding as I see it.
> > 
> > you're wrong. 1.5 and 3.5 both round to _even_ numbers, so they round
> > to 0 and 4.
> 
> Holy shit. So, the nearest integer to 1.5 is 0? And what about 2 and 1?
> I assume there are further away in some strange metrics.
> Torinthiel

no, i was just smoking crack. :) 1.5 rounds to 2, of course, not 0.
sorry.

rich




More information about the MPlayer-dev-eng mailing list