Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Richard Henderson <rth@dot.cygnus.com>
Subject: Re: Severe errors with fscanf/sscanf (RH 4.2/5.0)
Date: Wed, 11 Feb 1998 11:26:05 -0800	[thread overview]
Message-ID: <95ae9661741f20fe4b71b5dd2dd9f5a3.axp-list@archive.invalid> (raw)
In-Reply-To: <34E1E403.8E292D6E@voicenet.com>

--t9RHnE3ZwKMSgU+y
Content-Type: text/plain; charset=us-ascii

On Wed, Feb 11, 1998 at 12:46:44PM -0500, Uncle George wrote:
> it seems that one cannot shift more that 63 bits with a right shift on the
> alpha. Anyone trying to shift 64 or more bits will result in a no-op,

That is correct.  In the definition of mpn_lshift, COUNT must be
between 1 and N-1, so it was the caller that was in error.  Here
is a patch, which fixes the example that was provided. 

Thanks for the pointer.

r~

--t9RHnE3ZwKMSgU+y
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=d-fp

1998-02-11 19:16  Richard Henderson  <rth@cygnus.com>

	* stdlib/strtod.c (STRTOF): Don't call lshift with zero count.

Index: stdlib/strtod.c
===================================================================
RCS file: /egcs/carton/cvsfiles/libc/stdlib/strtod.c,v
retrieving revision 1.36.2.3
diff -u -p -r1.36.2.3 strtod.c
--- strtod.c	1997/11/19 23:26:56	1.36.2.3
+++ strtod.c	1998/02/11 19:16:12
@@ -874,10 +874,13 @@ INTERNAL (STRTOF) (nptr, endptr, group)
 
     count_leading_zeros (cnt, den[densize - 1]);
 
-    (void) __mpn_lshift (den, den, densize, cnt);
-    cy = __mpn_lshift (num, num, numsize, cnt);
-    if (cy != 0)
-      num[numsize++] = cy;
+    if (cnt > 0)
+      {
+	(void) __mpn_lshift (den, den, densize, cnt);
+	cy = __mpn_lshift (num, num, numsize, cnt);
+	if (cy != 0)
+	  num[numsize++] = cy;
+      }
 
     /* Now we are ready for the division.  But it is not necessary to
        do a full multi-precision division because we only need a small

--t9RHnE3ZwKMSgU+y--

-- 
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

       reply	other threads:[~1998-02-11 19:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <34E1E403.8E292D6E@voicenet.com>
1998-02-11 19:26 ` Richard Henderson [this message]
     [not found] <34E23533.2929FAC3@voicenet.com>
1998-02-11 23:52 ` Severe errors with fscanf/sscanf (RH 4.2/5.0) Richard Henderson
1998-02-11 23:33 Uncle George
  -- strict thread matches above, loose matches on Subject: below --
1998-02-11 17:46 Uncle George
1998-02-10 19:22 Richard Henderson
1998-02-10 13:31 Uncle George
1998-02-10  8:38 Stefan Illy
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox