- 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
推薦閱讀
- Data Visualization with D3 4.x Cookbook(Second Edition)
- C語言程序設(shè)計(第3版)
- Delphi程序設(shè)計基礎(chǔ):教程、實驗、習(xí)題
- 深入淺出Electron:原理、工程與實踐
- Python爬蟲開發(fā):從入門到實戰(zhàn)(微課版)
- Processing互動編程藝術(shù)
- 你必須知道的204個Visual C++開發(fā)問題
- 小程序開發(fā)原理與實戰(zhàn)
- C語言程序設(shè)計同步訓(xùn)練與上機指導(dǎo)(第三版)
- Mastering React
- Orleans:構(gòu)建高性能分布式Actor服務(wù)
- OpenMP核心技術(shù)指南
- SQL Server 2016 從入門到實戰(zhàn)(視頻教學(xué)版)
- Getting Started with Polymer
- Java 從入門到項目實踐(超值版)