Message-ID: <4E903172.4050701@gmail.com>
Date: 2011-10-08T11:18:10Z
From: Duncan Murdoch
Subject: round() and negative digits
In-Reply-To: <4E8F6E6E.9050604@witthoft.com>
On 11-10-07 5:26 PM, Carl Witthoft wrote:
> Just wondering here -- I tested and found to my delight that
>
> % round(325.4,-2)
> [1] 300
>
> gave me exactly what I would have expected (and wanted). Since it's not
> explicitly mentioned in the documentation that negative 'digits' is
> allowed, I just wanted to ask whether this behavior is intentional or a
> happy turn of events. I'm always paranoid that something not explicitly
> documented might disappear in future revisons.
>
It is intentional, and one of the regression tests confirms that it's
there, so it won't disappear by mistake, and would be very unlikely to
disappear intentionally.
Duncan Murdoch