1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-01-17 05:28:37 +01:00

[Perl6/en]Modify an error about the Range constructor (#3612)

[Perl6/en] Modify an error about the Range constructor
This commit is contained in:
Amans Tofu 2019-08-30 17:22:27 +08:00 committed by Divay Prakash
parent 88223544ce
commit f0f161981f

View File

@ -499,10 +499,19 @@ say False ~~ True; #=> True
## Range constructor
##------------------
3 .. 7; # 3 to 7, both included
3 .. 7; # 3 to 7, both included.
3 ..^ 7; # 3 to 7, exclude right endpoint.
3 ^.. 7; # 3 to 7, exclude left endpoint. Same as `4..7`.
3 ^..^ 7; # 3 to 7, exclude both endpoints. Same as `4..6`.
3 ^.. 7; # 3 to 7, exclude left endpoint.
3 ^..^ 7; # 3 to 7, exclude both endpoints.
# 3 ^.. 7 almost like 4 .. 7 when we only consider integers.
# But when we consider decimals :
3.5 ~~ 4 .. 7; # False
3.5 ~~ 3 ^.. 7; # True, This Range also contains decimals greater than 3.
# We describe it like this in some math books: 3.5 ∈ (3,7]
# If you dont want to understand the concept of interval
# for the time being. At least we should know
3 ^.. 7 ~~ 4 .. 7; # False
## This also works as a shortcut for `0..^N`:
^10; # means 0..^10