diff options
Diffstat (limited to 'src/pkg/math/sqrt.go')
-rw-r--r-- | src/pkg/math/sqrt.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pkg/math/sqrt.go b/src/pkg/math/sqrt.go index b7fd4ee60..7a5b69a42 100644 --- a/src/pkg/math/sqrt.go +++ b/src/pkg/math/sqrt.go @@ -20,12 +20,12 @@ package math // Sqrt(x < 0) = NaN func Sqrt(x float64) float64 { if IsInf(x, 1) { - return x; + return x } if x <= 0 { if x < 0 { - return NaN(); + return NaN() } return 0; } @@ -59,7 +59,7 @@ func Sqrt(x float64) float64 { } for i := 0; i <= 4; i++ { - temp = 0.5*(temp + x/temp); + temp = 0.5*(temp + x/temp) } return temp; } |