- Perl 6 Deep Dive
- Andrew Shitov
- 43字
- 2021-07-03 00:05:52
Methods pred and succ
These two methods work similar to how they work on an integer value. The integer part is returned, incremented or decremented, while the floating part is unchanged, as shown as follows:
say 3.14.pred; # 2.14
say 3.14.succ; # 4.14