- Perl 6 Deep Dive
- Andrew Shitov
- 71字
- 2021-07-03 00:05:50
Getting the next and previous values
The two methods, pred and succ, correspondingly return the previous and the next values for integer arguments:
say 42.pred; # 41
say 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.14159265358979
say (3/4).succ; # 1.75
The names of the methods come from the words predecessor and successor.
推薦閱讀
- Oracle從入門到精通(第3版)
- Computer Vision for the Web
- Power Up Your PowToon Studio Project
- PyTorch自動駕駛視覺感知算法實戰
- 深入淺出Java虛擬機:JVM原理與實戰
- Podman實戰
- Spring Boot企業級項目開發實戰
- Spring+Spring MVC+MyBatis整合開發實戰
- Oracle數據庫編程經典300例
- Learning iOS Security
- 零基礎學Java第2版
- Data Manipulation with R(Second Edition)
- 零基礎學SQL(升級版)
- 軟技能2:軟件開發者職業生涯指南
- 大話C語言