るりまサーチ

最速Rubyリファレンスマニュアル検索!
11件ヒット [1-11件を表示] (0.125秒)
トップページ > クエリ:float[x] > クエリ:E[x] > クエリ:random_number[x]

別のキーワード

  1. open3 popen2e
  2. socket af_e164
  3. matrix rank_e
  4. matrix det_e
  5. open3 capture2e

ライブラリ

モジュール

検索結果

SecureRandom.random_number(n = 0) -> Integer | Float (24408.0)

ランダムな数値を生成して返します。 n が 1 以上の整数の場合、0 以上 n 未満の整数を返します。 n が 0 の場合、0.0 以上 1.0 未満の実数を返します。

...1.0 未満の実数を返します。

@param n ランダムな数値の上限を数値で指定します。

@raise NotImplementedError 安全な乱数発生器が使えない場合に発生します。

require 'securerandom'
p SecureRandom.random_number(1 << 64) #=> 4078466195356651249...