summaryrefslogtreecommitdiff
path: root/src/pkg/cmath/sqrt.go
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2011-02-14 13:23:51 +0100
committerOndřej Surý <ondrej@sury.org>2011-02-14 13:23:51 +0100
commit758ff64c69e34965f8af5b2d6ffd65e8d7ab2150 (patch)
tree6d6b34f8c678862fe9b56c945a7b63f68502c245 /src/pkg/cmath/sqrt.go
parent3e45412327a2654a77944249962b3652e6142299 (diff)
downloadgolang-upstream/2011-02-01.1.tar.gz
Imported Upstream version 2011-02-01.1upstream/2011-02-01.1
Diffstat (limited to 'src/pkg/cmath/sqrt.go')
-rw-r--r--src/pkg/cmath/sqrt.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/pkg/cmath/sqrt.go b/src/pkg/cmath/sqrt.go
index 58bc4b691..e77a9b9df 100644
--- a/src/pkg/cmath/sqrt.go
+++ b/src/pkg/cmath/sqrt.go
@@ -57,20 +57,20 @@ import "math"
func Sqrt(x complex128) complex128 {
if imag(x) == 0 {
if real(x) == 0 {
- return cmplx(0, 0)
+ return complex(0, 0)
}
if real(x) < 0 {
- return cmplx(0, math.Sqrt(-real(x)))
+ return complex(0, math.Sqrt(-real(x)))
}
- return cmplx(math.Sqrt(real(x)), 0)
+ return complex(math.Sqrt(real(x)), 0)
}
if real(x) == 0 {
if imag(x) < 0 {
r := math.Sqrt(-0.5 * imag(x))
- return cmplx(r, -r)
+ return complex(r, -r)
}
r := math.Sqrt(0.5 * imag(x))
- return cmplx(r, r)
+ return complex(r, r)
}
a := real(x)
b := imag(x)
@@ -97,7 +97,7 @@ func Sqrt(x complex128) complex128 {
r *= scale
}
if b < 0 {
- return cmplx(t, -r)
+ return complex(t, -r)
}
- return cmplx(t, r)
+ return complex(t, r)
}