官术网_书友最值得收藏!

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
主站蜘蛛池模板: 长春市| 康定县| 鹰潭市| 台北市| 湖南省| 威信县| 大安市| 贺州市| 沈阳市| 南漳县| 盘锦市| 如皋市| 方山县| 恩施市| 老河口市| 遂溪县| 施甸县| 湘乡市| 抚州市| 博罗县| 应城市| 望奎县| 当涂县| 绥中县| 特克斯县| 南康市| 新乐市| 滦南县| 古蔺县| 黄骅市| 巩留县| 崇义县| 富源县| 常熟市| 屏山县| 金坛市| 宜都市| 页游| 城口县| 浑源县| 林西县|