Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
9b1d6332
Commit
9b1d6332
authored
Apr 09, 2010
by
Charles L. Dorian
Committed by
Russ Cox
Apr 09, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmath: use ** for exponentiation in comments
R=rsc CC=golang-dev
https://golang.org/cl/831045
parent
a4f8d36b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
5 deletions
+5
-5
exp.go
src/pkg/cmath/exp.go
+1
-1
polar.go
src/pkg/cmath/polar.go
+1
-1
pow.go
src/pkg/cmath/pow.go
+1
-1
sqrt.go
src/pkg/cmath/sqrt.go
+2
-2
No files found.
src/pkg/cmath/exp.go
View file @
9b1d6332
...
...
@@ -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
))
...
...
src/pkg/cmath/polar.go
View file @
9b1d6332
...
...
@@ -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
)
...
...
src/pkg/cmath/pow.go
View file @
9b1d6332
...
...
@@ -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
{
...
...
src/pkg/cmath/sqrt.go
View file @
9b1d6332
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment