- 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
推薦閱讀
- Java開發(fā)入行真功夫
- Interactive Applications Using Matplotlib
- Yii Project Blueprints
- Swift 4 Protocol-Oriented Programming(Third Edition)
- ArcGIS for Desktop Cookbook
- Raspberry Pi Robotic Blueprints
- 實戰(zhàn)Java高并發(fā)程序設計(第2版)
- OpenMP核心技術指南
- Flask Web開發(fā):基于Python的Web應用開發(fā)實戰(zhàn)(第2版)
- Python Web自動化測試設計與實現(xiàn)
- NGUI for Unity
- 3D Printing Designs:The Sun Puzzle
- Getting Started with hapi.js
- Getting Started with Web Components
- 和孩子一起學編程:用Scratch玩Minecraft我的世界