Gerhard Niklasch on Sat, 1 Aug 1998 17:45:43 +0200 (MET DST)

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

3E12 != 3E-12, I hope. :)

The patchlet below (against 2.0.11.beta) fixes the following:
(15:20) gp > 1E3
%14 = 1000.000000000000000000000000
(15:20) gp > 1E-12
%15 = 9.999999999999999999999999999 E-13
(15:20) gp > 1E3
%16 = 0.0009999999999999999999999999999
which may or may not have bitten you, depending on O/S, compiler and
C libraries.  (I saw it on Linux with gcc, but not on Solaris with gcc,
neither on Solaris PCs nor on Solaris Sparcs.  It's always the one-liner
and two-liner bugs that cause the largest amount of gray/torn hair...)

Cheers, Gerhard

PS Another patch for mpqs.c to follow shortly;  whilst removing a rare
file descriptor leak I had inadvertently introduced another not-so-rare
one, so that 2.0.11.beta's gp as distributed will not factor more than
about 250 numbers with MPQS before running out of fd's on many systems.
(The larger the numbers you are trying to factor, the less often this will
happen:  if you're testing it on 100-digit numbers, you probably wouldn't
have noticed a problem by the time 2.0.12 comes out. ;^).

PPS Monolith services seem to be down at the minute, so the
website may be unreachable under that name for a little while.  The long
form ought to work as

bash$ diff -u src/language/anal.c.orig src/language/anal.c
--- src/language/anal.c.orig	Sat Aug  1 17:27:38 1998
+++ src/language/anal.c	Sat Aug  1 17:29:19 1998
@@ -1481,11 +1481,11 @@
     case 'E': case 'e':
       char *old = analyseur;
-      int plus;
+      int plus = 1;
         case '-': plus=0; analyseur++; break;
-        case '+': plus=1; analyseur++;
+        case '+': analyseur++;
       m = number(&nb); if (plus) n += m; else n -= m;
       if (nb > 8) err(talker2,"exponent too large: ",old,mark.start);