33件ヒット
[1-33件を表示]
(0.016秒)
ライブラリ
- ビルトイン (33)
検索結果
-
Random
# rand -> Float (117.0) -
一様な擬似乱数を発生させます。
...は数値である必要があり、
range.begin + 数値 が適切な値を返す必要があります。
@raise Errno::EDOM rand(1..Float::INFINITY) などのように範囲に問題があるときに発生します。
@raise ArgumentError 引数の数が0または1では無い時、......な値が存在しない範囲を渡した時などに発生します。
//emlist[例][ruby]{
# Kernel.#rand とほぼ同様の使い勝手
prng = Random.new(1234)
prng.rand # => 0.1915194503788923
srand(1234)
rand # => 0.1915194503788923
# max に実数も指定出来......w(2012, 1, 1) ... Date.new(2013,1,1)) # => #<Date: 2012-01-31 ((2455958j,0s,0n),+0s,2299161j)>
# Kernel.#rand とほぼ同様の使い勝手
prng = Random.new(1234)
prng.rand # => 0.1915194503788923
srand(1234)
rand # => 0.1915194503788923
# max に実数も指定出来... -
Random
# rand(max) -> Integer | Float (117.0) -
一様な擬似乱数を発生させます。
...は数値である必要があり、
range.begin + 数値 が適切な値を返す必要があります。
@raise Errno::EDOM rand(1..Float::INFINITY) などのように範囲に問題があるときに発生します。
@raise ArgumentError 引数の数が0または1では無い時、......な値が存在しない範囲を渡した時などに発生します。
//emlist[例][ruby]{
# Kernel.#rand とほぼ同様の使い勝手
prng = Random.new(1234)
prng.rand # => 0.1915194503788923
srand(1234)
rand # => 0.1915194503788923
# max に実数も指定出来......w(2012, 1, 1) ... Date.new(2013,1,1)) # => #<Date: 2012-01-31 ((2455958j,0s,0n),+0s,2299161j)>
# Kernel.#rand とほぼ同様の使い勝手
prng = Random.new(1234)
prng.rand # => 0.1915194503788923
srand(1234)
rand # => 0.1915194503788923
# max に実数も指定出来... -
Random
# rand(range) -> Integer | Float (117.0) -
一様な擬似乱数を発生させます。
...は数値である必要があり、
range.begin + 数値 が適切な値を返す必要があります。
@raise Errno::EDOM rand(1..Float::INFINITY) などのように範囲に問題があるときに発生します。
@raise ArgumentError 引数の数が0または1では無い時、......な値が存在しない範囲を渡した時などに発生します。
//emlist[例][ruby]{
# Kernel.#rand とほぼ同様の使い勝手
prng = Random.new(1234)
prng.rand # => 0.1915194503788923
srand(1234)
rand # => 0.1915194503788923
# max に実数も指定出来......w(2012, 1, 1) ... Date.new(2013,1,1)) # => #<Date: 2012-01-31 ((2455958j,0s,0n),+0s,2299161j)>
# Kernel.#rand とほぼ同様の使い勝手
prng = Random.new(1234)
prng.rand # => 0.1915194503788923
srand(1234)
rand # => 0.1915194503788923
# max に実数も指定出来...