summaryrefslogtreecommitdiff
path: root/src/pkg/math/gamma.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/math/gamma.go')
-rw-r--r--src/pkg/math/gamma.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pkg/math/gamma.go b/src/pkg/math/gamma.go
index 7365d8e77..7c6f421ba 100644
--- a/src/pkg/math/gamma.go
+++ b/src/pkg/math/gamma.go
@@ -116,12 +116,12 @@ func stirling(x float64) float64 {
// Gamma(±Inf) = ±Inf
// Gamma(NaN) = NaN
// Large values overflow to +Inf.
-// Negative integer values equal ±Inf.
+// Zero and negative integer arguments return ±Inf.
func Gamma(x float64) float64 {
const Euler = 0.57721566490153286060651209008240243104215933593992 // A001620
// special cases
switch {
- case x < -MaxFloat64 || x != x: // IsInf(x, -1) || IsNaN(x):
+ case IsInf(x, -1) || IsNaN(x):
return x
case x < -170.5674972726612 || x > 171.61447887182298:
return Inf(1)