]> Cypherpunks repositories - gostls13.git/commitdiff
math: the trig functions work in radians; document that
authorRob Pike <r@golang.org>
Mon, 7 Oct 2013 23:32:47 +0000 (16:32 -0700)
committerRob Pike <r@golang.org>
Mon, 7 Oct 2013 23:32:47 +0000 (16:32 -0700)
Fixes #6543
6543 is also a fine NGC object.

R=golang-dev, dsymonds, kamil.kisiel, minux.ma
CC=golang-dev
https://golang.org/cl/14515044

src/pkg/math/asin.go
src/pkg/math/atan.go
src/pkg/math/sin.go
src/pkg/math/tan.go

index 00bf61ee4bf06152b1cb3fef4bbda739673145ca..88b851e5508cbcbeaa25894023f30fb544b750d6 100644 (file)
@@ -11,7 +11,7 @@ package math
        after appropriate range reduction.
 */
 
-// Asin returns the arcsine of x.
+// Asin returns the arcsine, in radians, of x.
 //
 // Special cases are:
 //     Asin(±0) = ±0
@@ -44,7 +44,7 @@ func asin(x float64) float64 {
        return temp
 }
 
-// Acos returns the arccosine of x.
+// Acos returns the arccosine, in radians, of x.
 //
 // Special case is:
 //     Acos(x) = NaN if x < -1 or x > 1
index c107d388d397b37d0402ab7325a624e0e7608a99..7fcc90b8b0aeb5f419c927624df8620b115d6682 100644 (file)
@@ -87,7 +87,7 @@ func satan(x float64) float64 {
        return Pi/4 + xatan((x-1)/(x+1)) + 0.5*Morebits
 }
 
-// Atan returns the arctangent of x.
+// Atan returns the arctangent, in radians, of x.
 //
 // Special cases are:
 //      Atan(±0) = ±0
index 8beb8bbe3410ca98944b180d37ba4956ea32cb51..ed85f21be484a56f359d4b71c2b60a5f8b8a6a14 100644 (file)
@@ -109,7 +109,7 @@ var _cos = [...]float64{
        4.16666666666665929218E-2,   // 0x3fa555555555554b
 }
 
-// Cos returns the cosine of x.
+// Cos returns the cosine of the radian argument x.
 //
 // Special cases are:
 //     Cos(±Inf) = NaN
@@ -165,7 +165,7 @@ func cos(x float64) float64 {
        return y
 }
 
-// Sin returns the sine of x.
+// Sin returns the sine of the radian argument x.
 //
 // Special cases are:
 //     Sin(±0) = ±0
index b2f29cc3b3033384e6a161e4a225ccc3dbf57053..285eff1aba27ea643ee9056c06dd5bbf8aae2c39 100644 (file)
@@ -73,7 +73,7 @@ var _tanQ = [...]float64{
        -5.38695755929454629881E7, //0xc189afe03cbe5a31
 }
 
-// Tan returns the tangent of x.
+// Tan returns the tangent of the radian argument x.
 //
 // Special cases are:
 //     Tan(±0) = ±0