[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    Re: ARTS_1_1_BRANCH: arts/soundserver
From:       Matthias Kretz <kretz () kde ! org>
Date:       2003-07-31 23:02:23
[Download RAW message or body]


Hmm, interesting.

float a = 1.2;
float b = fabs( a );

is not equivalent to

float a = -1.2;
float b = fabsf( a );

right? The second one should be more efficient (I'm thinking of loops where 
fabs( float ) is called like 4*44100 times per second), no?

How about:

float myfabsf( a )
{
	long x = 0x7FFFFFFF & *((long*)&a);
	return *((float*)&x);
}

On Friday August 1 2003 00:38, George Staikos wrote:
> CVS commit by staikos:
>
> no fabsf() in non-C99 environments
>
> This should be forward ported.
>
> CCMAIL: 61796-done@bugs.kde.org
>
>
>   M +1 -1      artsd.cc   1.43.2.3
>
>
> --- arts/soundserver/artsd.cc  #1.43.2.2:1.43.2.3
> @@ -292,5 +292,5 @@ int main(int argc, char **argv)
>          AudioManager audioManager;
>
> -        if (fabsf(cfgVolume) > 1e-10)
> +        if (fabs(cfgVolume) > 1e-10)
>                  server.outVolume().scaleFactor(cfgVolume);

-- 
C'ya
        Matthias
________________________________________________________
Matthias Kretz (Germany)                          <><
http://Vir.homeip.net/
MatthiasKretz@gmx.net, kretz@kde.org,
Matthias.Kretz@urz.uni-heidelberg.de

[Attachment #3 (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic