-/* Copyright (C) 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Geoffrey Keating <Geoff.Keating@anu.edu.au>, 1997.
memset (x, 0, sizeof (mp1));
for (i = -1; i < 100 && i < FRAC / 4; ++i)
- x[(FRAC - i * 4 - 4) / mpbpl] |= (strchr (hexdig, str[i + 1]) - hexdig
+ x[(FRAC - i * 4 - 4) / mpbpl] |= ((strchr (hexdig, str[i + 1]) - hexdig)
<< (FRAC - i * 4 - 4) % mpbpl);
}
for (i = SIZE - 1; i > 0; --i)
if (SRC_PTR[i] != 0)
break;
- for (j = mpbpl - 1; j > 0; --j)
- if ((SRC_PTR[i] & 1 << j) != 0)
+ for (j = mpbpl - 1; j >= 0; --j)
+ if ((SRC_PTR[i] & (mp_limb_t)1 << j) != 0)
break;
- return i * 32 + j;
+ return i * mpbpl + j;
}
int
e2s = mpn_bitsize (e2, SZ);
e3s = mpn_bitsize (e3, SZ);
- if (e3s > 1 && e2s - e3s < 54)
+ if (e3s >= 0 && e2s - e3s < 54)
{
#if PRINT_ERRORS
printf ("%06x ", i * (0x100000 / (1 << N2)));