るりまサーチ (Ruby 2.5.0)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.014秒)
トップページ > バージョン:2.5.0[x] > クエリ: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 (54643.0)

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

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

@param x 実数

@raise TypeError xに数値以外を指定した場合に発生します。

@raise Math::DomainError x に負の整数、もしくは -∞ を渡した場合に発生します。

@raise RangeError 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...