@@ -583,9 +583,9 @@ or an explicit base in adverbial notation like C<< :16<A0> >> specifies it
583
583
otherwise. Unlike other programming languages, leading zeros do I < not > indicate
584
584
base 8; instead a compile-time warning is issued.
585
585
586
- In all literal formats, you can use underscores to group digits; they
587
- don't carry any semantic information; the following literals all
588
- evaluate to the same number:
586
+ In all literal formats, you can use underscores to group digits, although they
587
+ don't carry any semantic information; the following literals all evaluate to the
588
+ same number:
589
589
590
590
= begin code :skip-test
591
591
1000000
@@ -594,21 +594,21 @@ evaluate to the same number:
594
594
100_00_00
595
595
= end code
596
596
597
- = head4 Int literals
597
+ = head4 C < Int > literals
598
598
599
599
Integers default to signed base-10, but you can use other bases. For details,
600
600
see L < Int|/type/Int > .
601
601
602
602
= begin code :skip-test
603
- # actually not a literal, but unary - operator applied to numeric literal 2
603
+ # not a single literal, but unary - operator applied to numeric literal 2
604
604
-2
605
605
12345
606
606
0xBEEF # base 16
607
607
0o755 # base 8
608
608
:3<1201> # arbitrary base, here base 3
609
609
= end code
610
610
611
- = head4 Rat literals
611
+ = head4 C < Rat > literals
612
612
613
613
L < Rat|/type/Rat > literals (rationals) are very common, and take the
614
614
place of decimals or floats in many other languages. Integer division
@@ -623,7 +623,7 @@ also results in a C<Rat>.
623
623
2/3 # Not actually a literal, but still a Rat
624
624
= end code
625
625
626
- = head4 Num literals
626
+ = head4 C < Num > literals
627
627
628
628
Scientific notation with an integer exponent to base ten after an C < e > produces
629
629
L < floating point number|/type/Num > :
@@ -636,7 +636,7 @@ L<floating point number|/type/Num>:
636
636
2e2.5 # error
637
637
= end code
638
638
639
- = head4 Complex literals
639
+ = head4 C < Complex > literals
640
640
641
641
L < Complex|/type/Complex > numbers are written either as an imaginary number
642
642
(which is just a rational number with postfix C < i > appended), or as a sum of
@@ -648,7 +648,7 @@ a real and an imaginary number:
648
648
= end code
649
649
650
650
X < |Pairs (literals) >
651
- = head3 Pair literals
651
+ = head3 X < Pair literals >
652
652
653
653
L < Pairs|/type/Pair > are made of a key and a value, and there are two
654
654
basic forms for constructing them: C << key => 'value' >> and
0 commit comments