[FFmpeg-devel] [FFmpeg-devel-irc] IRC log for 2010-04-14

Måns Rullgård mans
Fri Apr 23 21:20:36 CEST 2010


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.

>> 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).
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.

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list