Skip to content

Commit 4037bdd

Browse files
committed
Update ?NumericConstants
Document single underscores inside significand being ignored, give an example.
1 parent 222a4b0 commit 4037bdd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/library/base/man/NumericConstants.Rd

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@
5757

5858
Note that a leading plus or minus is not regarded by the parser as
5959
part of a numeric constant but as a unary operator applied to the constant.
60+
61+
In order to help make long numeric literals more readable, individual
62+
underscores between digits in the significant part of a number are
63+
ignored, making it possible to write \code{123_456_789}.
6064
}
6165
\note{
6266
When a string is parsed to input a numeric constant, the number may or
@@ -107,5 +111,8 @@ identical(1L, as.integer(1))
107111
108112
## You can combine the "0x" prefix with the "L" suffix :
109113
identical(0xFL, as.integer(15))
114+
115+
## Use underscores to split long literals:
116+
0x123_456_789p1
110117
}
111118
\keyword{documentation}

0 commit comments

Comments
 (0)