summaryrefslogtreecommitdiff
path: root/libm/powerpc/s_logb.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2005-03-06 07:11:53 +0000
committerEric Andersen <andersen@codepoet.org>2005-03-06 07:11:53 +0000
commitc4e44e97f8562254d9da898f6ed7e6cb4d8a3ce4 (patch)
tree6c61f83ac5b94085222b3eda8d731309d61be99b /libm/powerpc/s_logb.c
parentd4fad9c64ee518be51ecb40662af69b405a49556 (diff)
Trim off whitespace
Diffstat (limited to 'libm/powerpc/s_logb.c')
-rw-r--r--libm/powerpc/s_logb.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/libm/powerpc/s_logb.c b/libm/powerpc/s_logb.c
index 3a410ba5c..23c7270f9 100644
--- a/libm/powerpc/s_logb.c
+++ b/libm/powerpc/s_logb.c
@@ -32,8 +32,8 @@
* Standard 754. *
*******************************************************************************/
-typedef union
- {
+typedef union
+ {
struct {
#if defined(__BIG_ENDIAN__)
unsigned long int hi;
@@ -62,38 +62,38 @@ double logb ( double x )
{
DblInHex xInHex;
long int shiftedExp;
-
+
xInHex.dbl = x;
shiftedExp = ( xInHex.words.hi & 0x7ff00000UL ) >> 20;
-
- if ( shiftedExp == 2047 )
+
+ if ( shiftedExp == 2047 )
{ // NaN or INF
if ( ( ( xInHex.words.hi & signMask ) == 0 ) || ( x != x ) )
return x; // NaN or +INF return x
else
return -x; // -INF returns +INF
}
-
+
if ( shiftedExp != 0 ) // normal number
shiftedExp -= 1023; // unbias exponent
-
- else if ( x == 0.0 )
+
+ else if ( x == 0.0 )
{ // zero
xInHex.words.hi = 0x0UL; // return -infinity
return ( minusInf.dbl );
}
-
- else
+
+ else
{ // subnormal number
xInHex.dbl *= twoTo52; // scale up
shiftedExp = ( xInHex.words.hi & 0x7ff00000UL ) >> 20;
shiftedExp -= 1075; // unbias exponent
}
-
+
if ( shiftedExp == 0 ) // zero result
return ( 0.0 );
-
- else
+
+ else
{ // nonzero result
xInHex.dbl = klTod;
xInHex.words.lo += shiftedExp;