本文簡要介紹ruby語言中 Math.lgamma
的用法。
用法
lgamma(x) → [float, -1 or 1]
計算 x
的對數 gamma 和 x
的 gamma 符號。
[Math.log(Math.gamma(x).abs), Math.gamma(x) < 0 ? -1 : 1]
但避免 Math.gamma(x)
對於大 x 溢出。
Math.lgamma(0) #=> [Infinity, 1]
相關用法
- Ruby Math.log10用法及代碼示例
- Ruby Math.ldexp用法及代碼示例
- Ruby Math.log2用法及代碼示例
- Ruby Math.log用法及代碼示例
- Ruby Math.acosh用法及代碼示例
- Ruby Math.asinh用法及代碼示例
- Ruby Math.sinh用法及代碼示例
- Ruby Math.cbrt用法及代碼示例
- Ruby Math.atan用法及代碼示例
- Ruby Math.asin用法及代碼示例
- Ruby Math.gamma用法及代碼示例
- Ruby Math.erf用法及代碼示例
- Ruby Math.cosh用法及代碼示例
- Ruby Math.tan用法及代碼示例
- Ruby Math.erfc用法及代碼示例
- Ruby Math.tanh用法及代碼示例
- Ruby Math.frexp用法及代碼示例
- Ruby Math.exp用法及代碼示例
- Ruby Math.acos用法及代碼示例
- Ruby Math.sqrt用法及代碼示例
- Ruby Math.cos用法及代碼示例
- Ruby Math.atan2用法及代碼示例
- Ruby Math.atanh用法及代碼示例
- Ruby Math.sin用法及代碼示例
- Ruby Math.hypot用法及代碼示例
注:本文由純淨天空篩選整理自ruby-lang.org大神的英文原創作品 Math.lgamma。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。