September 2017
Beginner
402 pages
9h 52m
English
The two methods, pred and succ, correspondingly return the previous and the next values for integer arguments:
say 42.pred; # 41say 42.succ; # 43
This method also works with non-integer values, when they add or subtract 1, as shown in the next fragment:
say pi.pred; # 2.14159265358979say (3/4).succ; # 1.75
The names of the methods come from the words predecessor and successor.
Read now
Unlock full access