Skip to content

Commit 960e14c

Browse files
committed
add 0x and friends to class Int
1 parent e4ac430 commit 960e14c

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

doc/Type/Int.pod

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,18 @@ There are two main syntax forms for C<Int> literals
1313
123 # Int in decimal notation
1414
:16<BEEF> # Int in radix notations
1515
16-
Both forms allow underscores between any two digits which can serve as visual
16+
For your convenience common radix forms come with a prefix shortcut.
17+
18+
say so :2<11111111> == 0b11111111 == :8<377> == 0o377 == 255 == 0d255 == :16<ff> == 0xff;
19+
# OUTPUT«True␤»
20+
21+
All forms allow underscores between any two digits which can serve as visual
1722
separators, but don't carry any meaning:
1823
19-
5_00000 # five Lakhs
20-
500_000 # five hundred thousand
24+
5_00000 # five Lakhs
25+
500_000 # five hundred thousand
26+
0xBEEF_CAFE # a strange place
27+
:2<1010_1010> # 0d170
2128
2229
=head1 Methods
2330

0 commit comments

Comments
 (0)