- 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.
- Visual FoxPro程序設(shè)計(jì)教程(第3版)
- MySQL 8 DBA基礎(chǔ)教程
- C語(yǔ)言程序設(shè)計(jì)
- Java軟件開(kāi)發(fā)基礎(chǔ)
- HTML5秘籍(第2版)
- JavaScript程序設(shè)計(jì)(第2版)
- Developing SSRS Reports for Dynamics AX
- Illustrator CS6設(shè)計(jì)與應(yīng)用任務(wù)教程
- Building Dynamics CRM 2015 Dashboards with Power BI
- Java 9 Programming By Example
- 零基礎(chǔ)看圖學(xué)ScratchJr:少兒趣味編程(全彩大字版)
- Android嵌入式系統(tǒng)程序開(kāi)發(fā)(基于Cortex-A8)
- Spring Boot學(xué)習(xí)指南:構(gòu)建云原生Java和Kotlin應(yīng)用程序
- GO語(yǔ)言編程從入門(mén)到實(shí)踐
- C語(yǔ)言從入門(mén)到精通(微視頻精編版)