From 2182d5786b728bc2371b40f689ca73ee9df0cd88 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Fri, 9 May 2014 16:04:03 -0400 Subject: [PATCH] math/cmplx: specify which square root Sqrt returns Fixes #7851. LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://golang.org/cl/93200043 --- src/pkg/math/cmplx/sqrt.go | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pkg/math/cmplx/sqrt.go b/src/pkg/math/cmplx/sqrt.go index 179b5396ab..4ef6807add 100644 --- a/src/pkg/math/cmplx/sqrt.go +++ b/src/pkg/math/cmplx/sqrt.go @@ -54,6 +54,7 @@ import "math" // IEEE -10,+10 1,000,000 2.9e-16 6.1e-17 // Sqrt returns the square root of x. +// The result r is chosen so that real(r) ≥ 0 and imag(r) has the same sign as imag(x). func Sqrt(x complex128) complex128 { if imag(x) == 0 { if real(x) == 0 { -- 2.50.0