Re: [Rd] print(...,digits=2) behavior

From: Martin Maechler <>
Date: Mon, 07 Mar 2011 19:24:27 +0100

Taking up the thread that Ben Bolker started on Feb.5 ...

In the mean time, with lots of contributions from Petr Savicky, we have fixed the bug (and even related bugs that were not reported).

The consequence is that a sizable fraction of all (numeric) R outputs does change (very) slightly, typically using a digit more or less than previously.
Several of the recommended packages, e.g., needed some adjustments of their tests/* files.

Here are the current NEWS entries related to that:

[ ........ ]

    • Printing and formatting of floating point numbers is now using

      the correct number of digits, where it previously rarely differed
      by a few digits. (See “scientific” entry below.)  This affects
      _many_ * checks in packages.

[ ........ ]

    • The internal (C) function scientific(), at the heart of R's, format(x), print(x), etc, for numeric x, has been
      re-written in order to provide correct results, fixing PR#14491,
      notably in border cases, including when digits >= 16, thanks to
      substantial contributions (code and experiments) from Petr
      Savicky.  This affects a noticable amount of numeric output from

Feedback is welcome, but flames > /dev/null Martin Maechler mailing list Received on Mon 07 Mar 2011 - 18:27:21 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 08 Mar 2011 - 13:10:28 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive