summaryrefslogtreecommitdiff
path: root/math.c
diff options
context:
space:
mode:
authoreregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-20 10:35:26 (GMT)
committereregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-20 10:35:26 (GMT)
commit46cb75db9bbb5b7d79fa55b5e2813ad7c2d4ba08 (patch)
tree02351103d320b873336575a8eda134a3a5d976b7 /math.c
parent3786bd6096302218ef618d005c4e280c38f612d3 (diff)
* math.c: improve and fix documentation of sin, tan and log
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'math.c')
-rw-r--r--math.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/math.c b/math.c
index 2017e43..19001b4 100644
--- a/math.c
+++ b/math.c
@@ -105,7 +105,7 @@ math_cos(VALUE obj, VALUE x)
* call-seq:
* Math.sin(x) -> Float
*
- * Computes the cosine of +x+ (expressed in radians).
+ * Computes the sine of +x+ (expressed in radians).
* Returns a Float in the range -1.0..1.0.
*
* Domain: (−INFINITY, INFINITY)
@@ -129,13 +129,12 @@ math_sin(VALUE obj, VALUE x)
* Math.tan(x) -> Float
*
* Computes the tangent of +x+ (expressed in radians).
- * Returns a Float in the range -1.0..1.0.
*
- * Domain: n * (-PI/2, PI/2)
+ * Domain: (−INFINITY, INFINITY)
*
* Codomain: (−INFINITY, INFINITY)
*
- * Math.tan(5 * (Math::PI/2)) #=> 3266247870639074.0
+ * Math.tan(0) #=> 0.0
*
*/
@@ -418,21 +417,22 @@ math_exp(VALUE obj, VALUE x)
/*
* call-seq:
- * Math.log(x) -> Float
- * Math.log(num, base) -> Float
+ * Math.log(x) -> Float
+ * Math.log(x, base) -> Float
*
- * Returns the natural logarithm of +x+.
+ * Returns the logarithm of +x+.
* If additional second argument is given, it will be the base
- * of logarithm.
+ * of logarithm. Otherwise it is +e+ (for the natural logarithm).
*
* Domain: (0, INFINITY)
*
* Codomain: (-INFINITY, INFINITY)
*
+ * Math.log(0) #=> -Infinity
* Math.log(1) #=> 0.0
* Math.log(Math::E) #=> 1.0
* Math.log(Math::E**3) #=> 3.0
- * Math.log(12,3) #=> 2.2618595071429146
+ * Math.log(12, 3) #=> 2.2618595071429146
*
*/