]> Cypherpunks repositories - gostls13.git/commitdiff
cmath: use ** for exponentiation in comments
authorCharles L. Dorian <cldorian@gmail.com>
Fri, 9 Apr 2010 21:37:26 +0000 (14:37 -0700)
committerRuss Cox <rsc@golang.org>
Fri, 9 Apr 2010 21:37:26 +0000 (14:37 -0700)
R=rsc
CC=golang-dev
https://golang.org/cl/831045

src/pkg/cmath/exp.go
src/pkg/cmath/polar.go
src/pkg/cmath/pow.go
src/pkg/cmath/sqrt.go

index 7f7e53a640a53226e72857fc0b57839c3421edba..1a639c5969e13654a76eecbe0a56fec16fdb7f16 100644 (file)
@@ -47,7 +47,7 @@ import "math"
 //    DEC       -10,+10      8700       3.7e-17     1.1e-17
 //    IEEE      -10,+10     30000       3.0e-16     8.7e-17
 
-// Exp returns e^x, the base-e exponential of x.
+// Exp returns e**x, the base-e exponential of x.
 func Exp(x complex128) complex128 {
        r := math.Exp(real(x))
        s, c := math.Sincos(imag(x))
index 0573a99c5ecbb879d771a3099ba4cdfa1a9beca0..f55aef42b0c8aca6c43cfe192e4977fb303a09fc 100644 (file)
@@ -5,7 +5,7 @@
 package cmath
 
 // Polar returns the absolute value r and phase θ of x,
-// such that x = r * e^θi.
+// such that x = r * e**θi.
 // The phase is in the range (-Pi, Pi].
 func Polar(x complex128) (r, θ float64) {
        return Abs(x), Phase(x)
index bb86984337cc4688edfb2a90365841c017789ce1..de2c4db56ea71dd5c2d5bb4ba995dd32cb8be30c 100644 (file)
@@ -42,7 +42,7 @@ import "math"
 // arithmetic   domain     # trials      peak         rms
 //    IEEE      -10,+10     30000       9.4e-15     1.5e-15
 
-// Pow returns x^y, the base-x exponential of y.
+// Pow returns x**y, the base-x exponential of y.
 func Pow(x, y complex128) complex128 {
        modulus := Abs(x)
        if modulus == 0 {
index d4023184de8811b6a7763ff2529178008905c45a..58bc4b691d00fe4ac4ec0df753b71d02d0d7ccd9 100644 (file)
@@ -81,9 +81,9 @@ func Sqrt(x complex128) complex128 {
                b *= 0.25
                scale = 2
        } else {
-               a *= 1.8014398509481984e16 // 2^54
+               a *= 1.8014398509481984e16 // 2**54
                b *= 1.8014398509481984e16
-               scale = 7.450580596923828125e-9 // 2^-27
+               scale = 7.450580596923828125e-9 // 2**-27
        }
        r := math.Hypot(a, b)
        var t float64