Skip to content

Commit

Permalink
man
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelChirico committed May 7, 2024
1 parent 42abeab commit a083c99
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions man/setNumericRounding.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@
\alias{getNumericRounding}
\title{ Change or turn off numeric rounding }
\description{
Change rounding to 0, 1 or 2 bytes when joining, grouping or ordering numeric
Change rounding to 0, 1, ..., or 7 bytes when joining, grouping or ordering numeric
(i.e. double, POSIXct) columns.
}
\usage{
setNumericRounding(x)
getNumericRounding()
}
\arguments{
\item{x}{ integer or numeric vector: 0 (default), 1 or 2 byte rounding }
\item{x}{ integer or numeric vector: 0 (default), up to 7 bytes rounding }
}
\details{
Computers cannot represent some floating point numbers (such as 0.6)
precisely, using base 2. This leads to unexpected behaviour when joining or
grouping columns of type 'numeric'; i.e. 'double', see example below. In
cases where this is undesirable, data.table allows rounding such data up to
approximately 11 significant figures which is plenty of digits for many cases.
This is achieved by rounding the last 2 bytes off the significand. Other possible
This is achieved by rounding the last 2 bytes off the significand. Other common
values are 1 byte rounding, or no rounding (full precision, default).

It is bytes rather than bits because it is tied in with the radix sort
Expand All @@ -33,7 +33,7 @@ precision).
}
\value{
\code{setNumericRounding} returns no value; the new value is applied.
\code{getNumericRounding} returns the current value: 0, 1 or 2.
\code{getNumericRounding} returns the current value: an integer from 0 to 7.
}
\seealso{
\code{\link{datatable-optimize}}\cr
Expand Down

0 comments on commit a083c99

Please sign in to comment.