]> Cypherpunks repositories - gostls13.git/commitdiff
math: add special-cases comments to Sinh and Tanh.
authorCharles L. Dorian <cldorian@gmail.com>
Mon, 5 Dec 2011 19:01:24 +0000 (14:01 -0500)
committerRuss Cox <rsc@golang.org>
Mon, 5 Dec 2011 19:01:24 +0000 (14:01 -0500)
Also change "Special conditions" to "Special cases" as in other functions.

R=rsc, golang-dev
CC=golang-dev
https://golang.org/cl/5440078

src/pkg/math/sin.go
src/pkg/math/sincos.go
src/pkg/math/sinh.go
src/pkg/math/tan.go
src/pkg/math/tanh.go

index 9e553a268bddcec52c3f77ced2832aa5183d22b8..b2a3f8a4e0e3e119c8e748907dd0df8afa67c800 100644 (file)
@@ -110,7 +110,7 @@ var _cos = [...]float64{
 
 // Cos returns the cosine of x.
 //
-// Special conditions are:
+// Special cases are:
 //     Cos(±Inf) = NaN
 //     Cos(NaN) = NaN
 func Cos(x float64) float64 {
index f5412fd726f62ad2d33544eebc898c7ef7bcb59c..74294256bebde0ab5c0983c38318e89d0b6cc9f7 100644 (file)
@@ -8,7 +8,7 @@ package math
 
 // Sincos(x) returns Sin(x), Cos(x).
 //
-// Special conditions are:
+// Special cases are:
 //     Sincos(±0) = ±0, 1
 //     Sincos(±Inf) = NaN, NaN
 //     Sincos(NaN) = NaN, NaN
index eaf28a51cd648c95f62416c37c27d149a460aca6..139b911fe6564d93f6d54a5b85beb9599c3cc368 100644 (file)
@@ -17,6 +17,11 @@ package math
 */
 
 // Sinh returns the hyperbolic sine of x.
+//
+// Special cases are:
+//     Sinh(±0) = ±0
+//     Sinh(±Inf) = ±Inf
+//     Sinh(NaN) = NaN
 func Sinh(x float64) float64 {
        // The coefficients are #2029 from Hart & Cheney. (20.36D)
        const (
@@ -56,6 +61,11 @@ func Sinh(x float64) float64 {
 }
 
 // Cosh returns the hyperbolic cosine of x.
+//
+// Special cases are:
+//     Cosh(±0) = 1
+//     Cosh(±Inf) = +Inf
+//     Cosh(NaN) = NaN
 func Cosh(x float64) float64 {
        if x < 0 {
                x = -x
index 739ee80f76f986e7ebf5f3605203ccfa07242419..76131fcd935d18c13c263d800d666a0ed6e078df 100644 (file)
@@ -75,7 +75,7 @@ var _tanQ = [...]float64{
 
 // Tan returns the tangent of x.
 //
-// Special conditions are:
+// Special cases are:
 //     Tan(±0) = ±0
 //     Tan(±Inf) = NaN
 //     Tan(NaN) = NaN
index f4a8a5a4d60be1706eb0254d85c3a1388992988a..03a641b4da036c4d7382ca4189f779841e676cff 100644 (file)
@@ -12,6 +12,11 @@ package math
 */
 
 // Tanh computes the hyperbolic tangent of x.
+//
+// Special cases are:
+//     Tanh(±0) = ±0
+//     Tanh(±Inf) = ±1
+//     Tanh(NaN) = NaN
 func Tanh(x float64) float64 {
        if x < 0 {
                x = -x