- Perl 6 Deep Dive
- Andrew Shitov
- 67字
- 2021-07-03 00:05:50
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
推薦閱讀
- Python編程完全入門教程
- Internet of Things with the Arduino Yún
- AutoCAD VBA參數化繪圖程序開發與實戰編碼
- 可解釋機器學習:模型、方法與實踐
- Flutter跨平臺開發入門與實戰
- C++反匯編與逆向分析技術揭秘(第2版)
- Java Web應用開發給力起飛
- Android應用開發實戰(第2版)
- C# 7.0本質論
- SQL Server 2008實用教程(第3版)
- Swift Essentials(Second Edition)
- Django 2.0 入門與實踐
- 瘋狂Ajax講義(第3版)
- 算法(第4版)
- Learning PowerShell DSC(Second Edition)