官术网_书友最值得收藏!

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
主站蜘蛛池模板: 龙陵县| 宁陕县| 新丰县| 镶黄旗| 卓尼县| 镇坪县| 奉新县| 积石山| 比如县| 潍坊市| 石景山区| 长乐市| 柏乡县| 浏阳市| 伊春市| 大关县| 乌拉特中旗| 彭水| 郴州市| 海盐县| 石棉县| 泗水县| 会理县| 贵南县| 绥芬河市| 海南省| 蒙阴县| 合川市| 大厂| 阳新县| 梓潼县| 漾濞| 湟源县| 盐边县| 铜梁县| 胶南市| 汝南县| 沽源县| 阿克| 绵竹市| 金坛市|