- Perl 6 Deep Dive
- Andrew Shitov
- 146字
- 2021-07-03 00:05:52
Num versus Numeric versus Real
As you saw in the diagram of the type hierarchy, some of the nodes are placed in ovals instead of rectangle boxes. Those are roles. Roles provide some interfaces to the classes that are inherited from them. We will talk about roles in more detail in Chapter 8, Object-Oriented Programming.
Some of the methods that the Numeric role provides us with are: Real, Int, Rat, Num, and Bool to convert the values to other data types; log, log10, exp, roots, abs, and sqrt for the corresponding mathematical calculations; and the pair prec and succ.
The Real role class gives us, among the rest, the following methods: rand, sign, round, floor, ceiling, and truncate.
If you want to dig deep and see all the connections between the classes, refer to the documentation pages listed at https://docs.perl6.org/type.html.
- Rake Task Management Essentials
- 基于Java技術(shù)的Web應(yīng)用開發(fā)
- Learning AWS Lumberyard Game Development
- Mastering Yii
- Building Minecraft Server Modifications
- Windows Server 2016 Automation with PowerShell Cookbook(Second Edition)
- Haxe Game Development Essentials
- C#程序設(shè)計教程(第3版)
- 創(chuàng)意UI:Photoshop玩轉(zhuǎn)APP設(shè)計
- 測試架構(gòu)師修煉之道:從測試工程師到測試架構(gòu)師
- AMP:Building Accelerated Mobile Pages
- Python程序設(shè)計現(xiàn)代方法
- 編程改變生活:用PySide6/PyQt6創(chuàng)建GUI程序(進階篇·微課視頻版)
- Python語言及其應(yīng)用(第2版)
- Visual FoxPro程序設(shè)計(第二版)