Arbitrary-precision integers (included): Difference between revisions
Arbitrary-precision integers (included) (view source)
Revision as of 11:26, 25 June 2022
, 1 year ago→{{header|R}}
Not a robot (talk | contribs) (Add CLU) |
m (→{{header|R}}) |
||
Line 1,861:
=={{header|R}}==
R does not come with built-in support for arbitrary precision integers, but it can be implemented with the GMP library (there is also an interface to bc).
<lang
large
largestr
cat("first 20 digits:", substr(largestr, 1, 20), "\n",
"last 20 digits:", substr(largestr,nchar(largestr) - 19, nchar(largestr)), "\n",
"number of digits: ", nchar(largestr), "\n")</lang>
{{out}}
<pre>first 20 digits: 62060698786608744707
|