Arbitrary-precision integers (included)

AUTHOR

TimToady

Using the in-built capabilities of your language, calculate the integer value of:

5^{4^{3^2}}

Confirm that the first and last twenty digits of the answer are: 62060698786608744707...92256259918212890625

Find and show the number of decimal digits in the answer.

More

http://rosettacode.org/wiki/Arbitrary-precision_integers_(included)#Raku

What's interesting here?

  • metaoperator

  • casting

  • {} in string

use v6;



my $x = ~[**] 5, 4, 3, 2;
say "5**4**3**2 = {substr($x,0,20)}...{substr($x,$x.chars-20)} and has {$x.chars} digits";

# vim: expandtab shiftwidth=4 ft=perl6

See Also

100-doors.pl

100 Doors

24-game.pl

24 game

accumulator-factory.pl

Accumulator factory

ackermann-function.pl

Ackermann function

balanced-brackets.pl

Balanced brackets

binomial-coefficient.pl

Binomial Coefficient

copy-a-string.pl

Copy a string

create-a-two-dimensional-array-at-runtime.pl

Create a two-dimensional array at runtime

hailstone-sequence.pl

Hailstone sequence

last-fridays-of-year.pl

Last fridays of the year

prime-decomposition.pl

Prime decomposition

README.md

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.