aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@cygnus>1994-02-07 09:56:47 +0000
committerKen Raeburn <raeburn@cygnus>1994-02-07 09:56:47 +0000
commita5ac3a14a11e6028c79cc21898bc5f96fcb7fc6e (patch)
tree369ea40a393a7df42e5b847a3e3fd2f5303828c3 /gas
parent6f6712661fab60f0a53ca5f54a204f39ebb4eeba (diff)
downloadfsf-binutils-gdb-a5ac3a14a11e6028c79cc21898bc5f96fcb7fc6e.zip
fsf-binutils-gdb-a5ac3a14a11e6028c79cc21898bc5f96fcb7fc6e.tar.gz
fsf-binutils-gdb-a5ac3a14a11e6028c79cc21898bc5f96fcb7fc6e.tar.bz2
(atof_generic): Calculate maximum number of useful digits in integer
arithmetic, to eliminate only source of dependence on floating point support, which currently doesn't work yet on the Alpha.
Diffstat (limited to 'gas')
-rw-r--r--gas/atof-generic.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gas/atof-generic.c b/gas/atof-generic.c
index b55945a..6d6d195 100644
--- a/gas/atof-generic.c
+++ b/gas/atof-generic.c
@@ -319,10 +319,19 @@ atof_generic (address_of_string_pointer,
+ 1); /* Number of destination littlenums. */
/* Includes guard bits (two littlenums worth) */
+#if 0 /* The integer version below is very close, and it doesn't
+ require floating point support (which is currently buggy on
+ the Alpha). */
maximum_useful_digits = (((double) (precision - 2))
* ((double) (LITTLENUM_NUMBER_OF_BITS))
/ (LOG_TO_BASE_2_OF_10))
+ 2; /* 2 :: guard digits. */
+#else
+ maximum_useful_digits = (((precision - 2))
+ * ( (LITTLENUM_NUMBER_OF_BITS))
+ * 1000000 / 3321928)
+ + 2; /* 2 :: guard digits. */
+#endif
if (number_of_digits_available > maximum_useful_digits)
{