diff options
author | pbrook <pbrook@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-08-28 19:48:02 +0000 |
---|---|---|
committer | pbrook <pbrook@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-08-28 19:48:02 +0000 |
commit | a2784d66a1b5767f47ec8d93f97cc73008af89c3 (patch) | |
tree | 0371510fa89dbbdbb79289c112c2ac3536729a99 /libgfortran/runtime | |
parent | 25696d3f4c3e989d1ee68b70e567ce5fd21ee7c0 (diff) | |
download | gcc-a2784d66a1b5767f47ec8d93f97cc73008af89c3.tar.gz |
PR libfortran/17195
* libgfortran.h (rtoa): Remove prototype.
* runtime/error.c (rtoa): Remove.
* io/write.c (calculate_G_format): Don't add blanks if E format is
used. Add correct number of blanks when exponent width is specified.
(output_float): Rewrite.
testsuite/
* gfortran.dg/edit_real_1.f90: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@86701 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/runtime')
-rw-r--r-- | libgfortran/runtime/error.c | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/libgfortran/runtime/error.c b/libgfortran/runtime/error.c index 448ead871c6..74670b56d28 100644 --- a/libgfortran/runtime/error.c +++ b/libgfortran/runtime/error.c @@ -53,62 +53,6 @@ unsigned line; static char buffer[32]; /* buffer for integer/ascii conversions */ -/* rtoa()-- Real to ascii conversion for base 10 and below. - * Returns a pointer to a static buffer. */ - -char * -rtoa (double f, int length, int oprec) -{ - double n = f; - double fval, minval; - int negative, prec; - unsigned k; - char formats[16]; - - prec = 0; - negative = 0; - if (n < 0.0) - { - negative = 1; - n = -n; - } - - if (length >= 8) - minval = FLT_MIN; - else - minval = DBL_MIN; - - - if (n <= minval) - { - buffer[0] = '0'; - buffer[1] = '.'; - for (k = 2; k < 28 ; k++) - buffer[k] = '0'; - buffer[k+1] = '\0'; - return buffer; - } - fval = n; - while (fval > 1.0) - { - fval = fval / 10.0; - prec ++; - } - - prec = sizeof (buffer) - 2 - prec; - if (prec > 20) - prec = 20; - prec = prec > oprec ? oprec : prec ; - - if (negative) - sprintf (formats, "-%%.%df", prec); - else - sprintf (formats, "%%.%df", prec); - - sprintf (buffer, formats, n); - return buffer; -} - /* Returns a pointer to a static buffer. */ |