- 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
推薦閱讀
- CMDB分步構(gòu)建指南
- Visual C++實例精通
- 零基礎(chǔ)學(xué)Java程序設(shè)計
- Python時間序列預(yù)測
- 西門子S7-200 SMART PLC編程從入門到實踐
- Mastering Git
- ArcGIS for Desktop Cookbook
- Serverless Web Applications with React and Firebase
- Python趣味編程與精彩實例
- Elasticsearch搜索引擎構(gòu)建入門與實戰(zhàn)
- Python高性能編程(第2版)
- PHP 7 Programming Blueprints
- Java Web應(yīng)用開發(fā)
- Swift編程實戰(zhàn):iOS應(yīng)用開發(fā)實例及完整解決方案
- C#教程