[FFmpeg-devel] [FFmpeg-devel-irc] IRC log for 2010-04-14
Fri Apr 23 21:36:10 CEST 2010
On Fri, Apr 23, 2010 at 08:20:36PM +0100, M?ns Rullg?rd wrote:
> Michael Niedermayer <michaelni at gmx.at> writes:
> > On Fri, Apr 23, 2010 at 07:46:27PM +0100, M?ns Rullg?rd wrote:
> >> Michael Niedermayer <michaelni at gmx.at> writes:
> >> > On Thu, Apr 15, 2010 at 01:00:40AM +0100, irc at mansr.com wrote:
> >> > [...]
> >> >
> >> >> [21:56:17] <mru> don't remember what 1/-0 is defined as
> >> >> [21:58:02] <BastyCDGS> intuitively I would say -inf
> >> >> [21:58:09] <BastyCDGS> -1/-0 = +inf
> >> >> [21:58:23] <mru> negative zeros are evil anyway
> >> >> [21:58:32] <Dark_Shikari> it makes if( x == 0 ) hard
> >> >> [21:58:38] <Dark_Shikari> or at least annoying
> >> >> [21:58:48] <mru> bitmask
> >> >> [21:58:49] <BastyCDGS> yes I haven't ever heard of somebody really using this
> >> >> [21:58:53] <Dark_Shikari> Yeah, bitmask works
> >> >> [21:58:56] <Dark_Shikari> just more immediate bits
> >> >> [21:59:03] <BastyCDGS> or fabs(x) == 0.0
> >> >> [21:59:07] <mru> ugh
> >> >> [21:59:10] <BastyCDGS> :D
> >> >> [21:59:21] <mru> shift left one and test for zero
> >> >> [21:59:21] <BastyCDGS> but looks really lame i know
> >> >> [21:59:25] <Dark_Shikari> fabs *is* faster than abs ;)
> >> >> [21:59:36] <Dark_Shikari> clearly we should use one's complement for all data
> >> >> [21:59:39] <mru> if shift also sets flags
> >> >> [22:00:51] <BastyCDGS> luckily I doesn't happen that often that you have to divide some value by george w. bush's IQ :D
> >> >> [22:01:19] <mru> well, suppose you need to calculate wars/iq
> >> >> [22:01:49] <Dark_Shikari> how about pretzels/iq
> >> >> [22:02:01] <mru> wars/pretzel
> >> >> [22:02:46] <BastyCDGS> oh yeah you're right, for dividing by bush's IQ we have to introduce complex numbers
> >> >> [22:02:57] <BastyCDGS> oops dragging sqrt
> >> >> [22:05:59] <BastyCDGS> what about if ( x == 0.0 || x == -0.0 )?
> >> >
> >> > 0.0 == -0.0
> >> > if(x==0.0) is enough
> >> >
> >> > this fact comes from basic algebra and thus should be true in
> >> > every language though one cant be certain these days anymore ;)
> >> Wrong, this fact comes from IEEE754:
> >> Comparisons shall ignore the sign of zero (so +0 = -0).
> > it does not become wrong by being explicitly stated in IEEE754
> I didn't say your statement was wrong. Only your reasoning was wrong.
> The IEEE754 spec could say anything, algebra be damned.
yes, in this case we have slightly missunderstood each other.
though IEEE754 is trying to approximate common arithmetic of real numbers
and it seems they try to preserve as many algebraic rules as they can.
This makes sense as its also usefull to compilers optimizing code.
> >> Algebra as defined by mathematicians cannot be trusted around computers.
> > thats just because you dont know algebra
> I know algebra, and I know it's not the same as IEEE754. For
> instance, algebra does not have a concept of unordered numbers (NaN).
algebra doesnt even need any kind of ordering, you are thinking of
algebra as the 0 1 2 3 4 and + - * /
but really algebra is any set of elements with one or more well defined
operations that return only elements within this set. (IIRC)
> IEEE754 also defines rules when operating at the limits of the chosen
> precision which are outside normal algebra. It obviously tries to
> stay close to algebraic rules wherever possible, but a
> finite-precision system can never be fully compatible with an
> infinite-precision one.
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
I know you won't believe me, but the highest form of Human Excellence is
to question oneself and others. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: Digital signature
More information about the ffmpeg-devel