るりまサーチ

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

別のキーワード

  1. _builtin float
  2. float to_d
  3. json float
  4. float rationalize
  5. fiddle type_float

ライブラリ

モジュール

検索結果

Math.#gamma(x) -> Float (18214.0)

x のガンマ関数の値を返します。

...or xに実数以外の数値を指定した場合に発生します。

//emlist[例][ruby]{
def fact(n) (1..n).inject(1) {|r,i| r*i } end
1.upto(26) {|i| p [i, Math.gamma(i), fact(i-1)] }
# => [1, 1.0, 1]
# [2, 1.0, 1]
# [3, 2.0, 2]
# [4, 6.0, 6]
# [5, 24.0, 24]
# [6, 120.0, 120]
# [7,...
...09094217170944e+19, 51090942171709440000]
# [23, 1.1240007277776077e+21, 1124000727777607680000]
# [24, 2.5852016738885062e+22, 25852016738884976640000]
# [25, 6.204484017332391e+23, 620448401733239439360000]
# [26, 1.5511210043330954e+25, 15511210043330985984000000]
//}

@see Math.#lgamma...