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

Torinthiel torinthiel at megapolis.pl
Thu Sep 2 15:29:07 CEST 2004


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)
where sign, mantissa and exp are stored in memory and fraction is
a binary one, not decimal. (mantissa binary, exp decimal)
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.

> > And if I would like lrintf(0.3) to be 1, then I would use ceil(0.3).
> > Not fesetround(FE_TOUPPER); lrintf(0.3). It's faster IMHO, as no
> > setting in fe* is done and no checking in lrintf.
> no, ceil() == fsetround();lrintf();fsetround() on x86 at least

You say effect or implementation?
If implementation than libc suffered from some severe disoptimization.
Ceil was defined looong before lrintf if my knowledge is correct.

Anyway, is it still revelant?
Problem was that different versions returned different values.
So lets just decide which one is better and make both return it.
Torinthiel

-- 
 Waclaw "Torinthiel" Schiller       GG#: 542916, 3073512
   torinthiel(at)megapolis(dot)pl
   gpg: B06901F1 fpr: FAA3 559F CAE9 34DE CDC8  7346 2B6E 39F2 B069 01F1
 "No classmates may be used during this examination"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20040902/e3dfccc4/attachment.pgp>


More information about the MPlayer-dev-eng mailing list