September 2017
Beginner
402 pages
9h 52m
English
The value of the Int type is an integer value in Perl 6. The value can hold both positive and negative numbers, as well as zero, and the language does not limit the size of the number. It can be as small as one byte, for example, take a look at the following example:
say 42;
It can also be of arbitrary precision, as shown here:
say 239874637819093248768900298372340;
In the preceding examples, common decimal notation was used. Perl 6 allows using other bases; for example, 16 for hexadecimal values. To create an integer with a base other than 10, use the so-called adverbial notation, as shown in the following example:
say :16<D0CF11E>;
This will print 218951966, which is the decimal representation of the :16<D0CF11E> integer. ...
Read now
Unlock full access