public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Fix fcvt to only show 'ndigit' past decimal
@ 2019-12-18 19:56 Corinna Vinschen
  0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2019-12-18 19:56 UTC (permalink / raw)
  To: newlib-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=abcc586ffec05a7779f8474119407d050392ee18

commit abcc586ffec05a7779f8474119407d050392ee18
Author: Keith Packard <keithp@keithp.com>
Date:   Wed Dec 18 08:49:05 2019 -0800

    Fix fcvt to only show 'ndigit' past decimal
    
    Even if the number is really small and this means showing *no* digits.
    This makes newlib match glibc, and the fcvt posix man page.
    
    Signed-off-by: Keith Packard <keithp@keithp.com>

Diff:
---
 newlib/libc/stdlib/ecvtbuf.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/newlib/libc/stdlib/ecvtbuf.c b/newlib/libc/stdlib/ecvtbuf.c
index e3d7b55..12e8c9a 100644
--- a/newlib/libc/stdlib/ecvtbuf.c
+++ b/newlib/libc/stdlib/ecvtbuf.c
@@ -235,14 +235,7 @@ fcvtbuf (double invalue,
 
   save = fcvt_buf;
 
-  if (invalue < 1.0 && invalue > -1.0)
-    {
-      p = _dtoa_r (reent, invalue, 2, ndigit, decpt, sign, &end);
-    }
-  else
-    {
-      p = _dtoa_r (reent, invalue, 3, ndigit, decpt, sign, &end);
-    }
+  p = _dtoa_r (reent, invalue, 3, ndigit, decpt, sign, &end);
 
   /* Now copy */


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-12-18 19:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-18 19:56 [newlib-cygwin] Fix fcvt to only show 'ndigit' past decimal Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).