- 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
推薦閱讀
- Facebook Application Development with Graph API Cookbook
- 精通JavaScript+jQuery:100%動態網頁設計密碼
- 大學計算機基礎實驗教程
- Learning Bayesian Models with R
- MariaDB High Performance
- 深度強化學習算法與實踐:基于PyTorch的實現
- Learning Network Forensics
- Learning Python by Building Games
- PySpark Cookbook
- Service Mesh實戰:基于Linkerd和Kubernetes的微服務實踐
- Cocos2d-x Game Development Blueprints
- Web程序設計:ASP.NET(第2版)
- ArcPy and ArcGIS(Second Edition)
- Puppet 5 Beginner's Guide(Third Edition)
- Design Patterns and Best Practices in Java