- 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.
- 自己動手實現Lua:虛擬機、編譯器和標準庫
- 新一代通用視頻編碼H.266/VVC:原理、標準與實現
- 無代碼編程:用云表搭建企業數字化管理平臺
- TypeScript圖形渲染實戰:基于WebGL的3D架構與實現
- Python Data Analysis(Second Edition)
- 名師講壇:Java微服務架構實戰(SpringBoot+SpringCloud+Docker+RabbitMQ)
- Serverless架構
- MongoDB,Express,Angular,and Node.js Fundamentals
- Java高并發核心編程(卷1):NIO、Netty、Redis、ZooKeeper
- 小程序,巧應用:微信小程序開發實戰(第2版)
- Building Dynamics CRM 2015 Dashboards with Power BI
- Data Science Algorithms in a Week
- 軟件工程與UML案例解析(第三版)
- 編程的原則:改善代碼質量的101個方法
- Bitcoin Essentials