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

  • 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
主站蜘蛛池模板: 祁连县| 吉林市| 天柱县| 邳州市| 桃园市| 安义县| 株洲县| 杭锦旗| 景洪市| 临朐县| 石柱| 甘肃省| 古丈县| 墨竹工卡县| 体育| 雷州市| 厦门市| 揭阳市| 乐东| 文安县| 五家渠市| 上思县| 定结县| 玉门市| 二手房| 沙田区| 尚志市| 通许县| 腾冲县| 托克逊县| 杂多县| 左贡县| 名山县| 盖州市| 安平县| 蕲春县| 瑞金市| 怀仁县| 板桥市| 灵武市| 天门市|