- 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
推薦閱讀
- Learning Cython Programming(Second Edition)
- 移動UI設(shè)計(jì)(微課版)
- Learning Flask Framework
- Programming ArcGIS 10.1 with Python Cookbook
- The Computer Vision Workshop
- aelf區(qū)塊鏈應(yīng)用架構(gòu)指南
- Visual C
- 碼上行動:用ChatGPT學(xué)會Python編程
- 愛上micro:bit
- Java EE企業(yè)級應(yīng)用開發(fā)教程(Spring+Spring MVC+MyBatis)
- 汽車人機(jī)交互界面整合設(shè)計(jì)
- 跟戴銘學(xué)iOS編程:理順核心知識點(diǎn)
- Java高并發(fā)編程詳解:深入理解并發(fā)核心庫
- Elasticsearch Blueprints
- Deep Learning for Natural Language Processing