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

Calculating the square root of the value

To calculate the square root of the value, call the sqrt method on it:

say 9.sqrt; # 3

The routine is also defined in Perl 6 as a standalone built-in function. Consider the following code snippet:

say sqrt(9); # 3

As the sqrt method is inherited from the Numeric role, the result is a floating-point value:

say 10.sqrt; # 3.16227766016838
主站蜘蛛池模板: 肃宁县| 汝城县| 兴隆县| 从江县| 鹤壁市| 本溪市| 上犹县| 黔江区| 沙湾县| 鹿泉市| 琼中| 兴安盟| 新安县| 罗江县| 彭山县| 临泽县| 东乡族自治县| 拉萨市| 大竹县| 闻喜县| 徐水县| 临夏县| 盐亭县| 桃江县| 汾西县| 荔波县| 隆回县| 左云县| 香港| 浦东新区| 株洲县| 龙江县| 马边| 淄博市| 龙里县| 宝应县| 吴川市| 汝南县| 沧州市| 团风县| 永清县|