- Perl 6 Deep Dive
- Andrew Shitov
- 74字
- 2021-07-03 00:05:50
Generating a random number
The rand method returns a random number between zero and the given value. Notice that this method is inherited from the Real role (refer to the diagram at the beginning of the Using simple built-in data types section), and the return value is a floating-point number:
say 100.rand;
Running this code a few times results in different values being printed, as you can see here:
70.1530942429978
57.2150256026057
13.7542877975353
94.6395293813437
推薦閱讀
- Node.js Design Patterns
- C# Programming Cookbook
- Java高手真經(高級編程卷):Java Web高級開發技術
- Instant Typeahead.js
- Advanced Oracle PL/SQL Developer's Guide(Second Edition)
- Python數據結構與算法(視頻教學版)
- Visual Basic程序設計實踐教程
- Learning AWS
- Java圖像處理:基于OpenCV與JVM
- OpenCV 3 Blueprints
- jQuery for Designers Beginner's Guide Second Edition
- Software Development on the SAP HANA Platform
- SSH框架企業級應用實戰
- Python物理建模初學者指南(第2版)
- Docker on Windows