This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix docs for scalbn* and scalbl* functions


On Mar 22, 2013, Mark H Weaver <mhw@netris.org> wrote:

> 2013-03-22  Mark H Weaver  <mhw@netris.org>

> 	* manual/arith.texi (Normalization Functions): Fix prototypes for
> 	scalbn, scalbnf, scalbnl, scalbln, scalblnf, and scalblnl.

Hey, I'd noticed this too, and I had a patch in my tree to fix this too.

My patch also fixed the prototype incompatibility in a source file, that
is AFAICT unused.

Does it make sense to install this change?

Rename unused scalb to scalbn to match prototype.

From: Alexandre Oliva <aoliva@redhat.com>

for  ChangeLog

	* sysdeps/ieee754/support.c (scalbn): Rename from
	wrongly-typed scalb.  Adjust all callers.  Apparently unused.
---
 sysdeps/ieee754/support.c |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/sysdeps/ieee754/support.c b/sysdeps/ieee754/support.c
index 2651ea8..68d1b76 100644
--- a/sysdeps/ieee754/support.c
+++ b/sysdeps/ieee754/support.c
@@ -82,7 +82,7 @@ static char sccsid[] = "@(#)support.c	8.1 (Berkeley) 6/4/93";
     static const double novf=1.7E308, nunf=3.0E-308,zero=0.0;
 #endif	/* defined(vax)||defined(tahoe) */
 
-double scalb(x,N)
+double scalbn(x,N)
 double x; int N;
 {
         int k;
@@ -106,7 +106,7 @@ double x; int N;
         if( (k= *px & mexp ) != mexp ) {
             if( N<-2100) return(nunf*nunf); else if(N>2100) return(novf+novf);
             if( k == 0 ) {
-                 x *= scalb(1.0,(int)prep1);  N -= prep1; return(scalb(x,N));}
+                 x *= scalbn(1.0,(int)prep1);  N -= prep1; return(scalbn(x,N));}
 #endif	/* defined(vax)||defined(tahoe) */
 
             if((k = (k>>gap)+ N) > 0 )
@@ -115,7 +115,7 @@ double x; int N;
             else
                 if( k > -prep1 )
                                         /* gradual underflow */
-                    {*px=(*px&~mexp)|(short)(1<<gap); x *= scalb(1.0,k-1);}
+                    {*px=(*px&~mexp)|(short)(1<<gap); x *= scalbn(1.0,k-1);}
                 else
                 return(nunf*nunf);
             }
@@ -228,7 +228,7 @@ double x,p;
 
         else  if ( ((*pp & mexp)>>gap) <= 1 )
                 /* subnormal p, or almost subnormal p */
-            { double b; b=scalb(1.0,(int)prep1);
+            { double b; b=scalbn(1.0,(int)prep1);
               p *= b; x = drem(x,p); x *= b; return(drem(x,p)/b);}
         else  if ( p >= novf/2)
             { p /= 2 ; x /= 2; return(drem(x,p)*2);}
@@ -294,8 +294,8 @@ double x;
 
     /* scale x to [1,4) */
         n=logb(x);
-        x=scalb(x,-n);
-        if((m=logb(x))!=0) x=scalb(x,-m);       /* subnormal number */
+        x=scalbn(x,-n);
+        if((m=logb(x))!=0) x=scalbn(x,-m);       /* subnormal number */
         m += n;
         n = m/2;
         if((n+n)!=m) {x *= 2; m -=1; n=m/2;}
@@ -326,7 +326,7 @@ double x;
                 b=1.0+r/4;   if(b>1.0) t=1;
                 if(t>=0) q+=r; }
 
-end:        return(scalb(q,n));
+end:        return(scalbn(q,n));
 }
 
 #if 0

-- 
Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Software Evangelist      Red Hat Brazil Compiler Engineer

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]