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

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
主站蜘蛛池模板: 罗甸县| 定陶县| 寿光市| 沈阳市| 隆林| 忻州市| 都江堰市| 潜江市| 台湾省| 龙泉市| 丹寨县| 肥乡县| 新沂市| 金阳县| 磐石市| 新密市| 香格里拉县| 阳西县| 东乌珠穆沁旗| 西林县| 通江县| 萨嘎县| 东城区| 顺义区| 泾川县| 宾川县| 唐河县| 婺源县| 鸡东县| 玉田县| 崇信县| 江陵县| 讷河市| 武威市| 海淀区| 德庆县| 柳林县| 和田县| 鄢陵县| 西丰县| 邛崃市|