Jump to content

Arbitrary-precision integers (included): Difference between revisions

→‎{{header|Raku}}: print number of digits
(→‎{{header|Raku}}: no need to quote numbers)
(→‎{{header|Raku}}: print number of digits)
Line 1,966:
{{works with|Rakudo|2022.07}}
 
<syntaxhighlight lang="raku" line>use Test;
given [**] 5, 4, 3, 2 {
ok ~([**] 5, 4, 3, 2) ~~ /^ 62060698786608744707 <digit>* 92256259918212890625 $/,
use Test;
'5**4**3**2 has expected first and last twenty digits';</syntaxhighlight>
ok ~([**] 5, 4, 3, 2) ~~ok /^ 62060698786608744707 <digit>* 92256259918212890625 $/,
'5**4**3**2 has expected first and last twenty digits';</syntaxhighlight>
printf 'This number has %d digits', .chars;
}</syntaxhighlight>
{{out}}
<pre>ok 1 - 5**4**3**2 has expected first and last twenty digits</pre>
This number has 183231 digits</pre>
 
=={{header|REXX}}==
1,934

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.