--- tai_ui64.c 2003/03/23 18:00:29 1.2
+++ tai_ui64.c 2005/01/24 10:52:52 1.3
@@ -1,8 +1,7 @@
/*
** OSSP ui64 - 64-Bit Arithmetic
-** Copyright (c) 2002-2003 Ralf S. Engelschall <rse@engelschall.com>
-** Copyright (c) 2002-2003 The OSSP Project <http://www.ossp.org/>
-** Copyright (c) 2002-2003 Cable & Wireless Deutschland <http://www.cw.com/de/>
+** Copyright (c) 2002-2005 Ralf S. Engelschall <rse@engelschall.com>
+** Copyright (c) 2002-2005 The OSSP Project <http://www.ossp.org/>
**
** This file is part of OSSP ui64, a 64-bit arithmetic library
** which can be found at http://www.ossp.org/pkg/lib/ui64/.
@@ -109,15 +108,15 @@
10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, /* a...m */
23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35 /* m...z */
};
-
+
ui64_fill(z, 0);
if (str == NULL || (base < 2 || base > 36))
return z;
cp = str;
while (*cp != '\0' && isspace((int)(*cp)))
cp++;
- while ( *cp != '\0'
- && isalnum((int)(*cp))
+ while ( *cp != '\0'
+ && isalnum((int)(*cp))
&& map[(int)(*cp)-'0'] < base) {
z = ui64_muln(z, base, &carry);
if (carry)
@@ -150,7 +149,7 @@
str[i++] = map[r];
while (n > 1 && x.x[n-1] == 0)
n--;
- } while (i < (len-1) && (n > 1 || x.x[0] != 0));
+ } while (i < ((int)len-1) && (n > 1 || x.x[0] != 0));
str[i] = '\0';
for (j = 0; j < --i; j++) {
c = str[j];
@@ -318,7 +317,7 @@
int i;
int n, m;
int ovn;
-
+
/* determine actual number of involved digits */
n = ui64_len(x);
m = ui64_len(y);
@@ -364,7 +363,7 @@
qk := rx[k+m-2...k+m]/y[m-2...m-1] */
km = k + m;
y2 = (y.x[m-1]*UI64_BASE) + y.x[m-2];
- r3 = (rx.x[km]*(UI64_BASE*UI64_BASE)) +
+ r3 = (rx.x[km]*(UI64_BASE*UI64_BASE)) +
(rx.x[km-1]*UI64_BASE) + rx.x[km-2];
qk = r3 / y2;
if (qk >= UI64_BASE)
|