- Perl 6 Deep Dive
- Andrew Shitov
- 51字
- 2021-07-03 00:05:51
Getting the numerator and denominator
To get the two parts of a Rat value, use the numerator and denominator methods. Let's take a look at how they work on the example of the value from the previous section:
my $x = 10/3;
say $x.numerator; # 10
say $x.denominator; # 3
推薦閱讀
- Spring Cloud Alibaba核心技術與實戰案例
- 簡單高效LATEX
- HBase從入門到實戰
- Java程序員面試算法寶典
- 低代碼平臺開發實踐:基于React
- Go語言精進之路:從新手到高手的編程思想、方法和技巧(2)
- Python編程:從入門到實踐(第3版)
- 工業機器人離線編程
- Mastering Gephi Network Visualization
- .NET 4.0面向對象編程漫談:應用篇
- Groovy 2 Cookbook
- 計算機應用基礎(Windows 7+Office 2010)
- Apache Kafka 1.0 Cookbook
- Illustrator CS6中文版應用教程(第二版)
- 深度學習的數學:使用Python語言