- Perl 6 Deep Dive
- Andrew Shitov
- 89字
- 2021-07-03 00:05:51
Getting the Perl representation of the value
The perl method returns a string that can represent the Rat value as Perl 6 understands it in the source code. The result can either contain a decimal point or a slash, depending on what is better for precise representation of the value.
Consider a couple of examples that display the preceding idea:
my $x = 1/3;
say $x.perl; # <1/3>
my $y = 1/2;
say $y.perl; # 0.5
Even more, the following code is valid Perl 6 code:
say 10/20.perl; # 0.5
推薦閱讀
- 軟件項目估算
- Node.js 10實戰(zhàn)
- Web交互界面設(shè)計與制作(微課版)
- Object-Oriented JavaScript(Second Edition)
- 鋒利的SQL(第2版)
- Cybersecurity Attacks:Red Team Strategies
- Python深度學(xué)習(xí)原理、算法與案例
- JavaScript程序設(shè)計(第2版)
- Spring MVC+MyBatis開發(fā)從入門到項目實踐(超值版)
- Android嵌入式系統(tǒng)程序開發(fā):基于Cortex-A8(第2版)
- ActionScript 3.0從入門到精通(視頻實戰(zhàn)版)
- Learning D
- LabVIEW入門與實戰(zhàn)開發(fā)100例(第4版)
- 一覽眾山小:ASP.NET Web開發(fā)修行實錄
- Design Patterns and Best Practices in Java