From 46cb75db9bbb5b7d79fa55b5e2813ad7c2d4ba08 Mon Sep 17 00:00:00 2001 From: eregon Date: Mon, 20 May 2013 10:35:26 +0000 Subject: * 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 --- math.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'math.c') diff --git a/math.c b/math.c index 2017e43d91..19001b4429 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 * */ -- cgit v1.2.3