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

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
主站蜘蛛池模板: 买车| 留坝县| 彩票| 搜索| 阿瓦提县| 蕲春县| 德庆县| 昌江| 贵阳市| 芷江| 崇信县| 桐梓县| 随州市| 江津市| 温州市| 芜湖市| 巴青县| 得荣县| 遂川县| 平阳县| 呼和浩特市| 乃东县| 宁乡县| 乌兰察布市| 岐山县| 武山县| 攀枝花市| 嘉荫县| 四川省| 屯门区| 德保县| 长春市| 阿坝县| 肥西县| 松滋市| 天津市| 绥宁县| 康乐县| 灵石县| 鹰潭市| 高平市|