[FFmpeg-devel] [FFmpeg-devel-irc] IRC log for 2010-04-14
Michael Niedermayer
michaelni
Fri Apr 23 20:36:40 CEST 2010
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 ;)
a proof for this is:
1) 0 is the identity element of addition that is 0+a = a+0 = a
2) -0 is also an identity element of addition that is (-0)+a = a+(-0) = a
both true for all a in our algebra
now consider 0 + (-0)
by 1) 0 + (-0) = (-0)
by 2) 0 + (-0) = 0
thus (-0) = 0
You could avoid that by defining 0 or -0 differently but that should lead
to other unpleasant problems
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Those who are too smart to engage in politics are punished by being
governed by those who are dumber. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100423/e1f3b5a4/attachment.pgp>
More information about the ffmpeg-devel
mailing list