[前][次][番号順一覧][スレッド一覧]

ruby-changes:28800

From: eregon <ko1@a...>
Date: Mon, 20 May 2013 19:35:40 +0900 (JST)
Subject: [ruby-changes:28800] eregon:r40852 (trunk): * math.c: improve and fix documentation of sin, tan and log

eregon	2013-05-20 19:35:26 +0900 (Mon, 20 May 2013)

  New Revision: 40852

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=40852

  Log:
    * math.c: improve and fix documentation of sin, tan and log

  Modified files:
    trunk/ChangeLog
    trunk/math.c

Index: math.c
===================================================================
--- math.c	(revision 40851)
+++ math.c	(revision 40852)
@@ -105,7 +105,7 @@ math_cos(VALUE obj, VALUE x) https://github.com/ruby/ruby/blob/trunk/math.c#L105
  *  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: (NFINITY, INFINITY)
@@ -129,13 +129,12 @@ math_sin(VALUE obj, VALUE x) https://github.com/ruby/ruby/blob/trunk/math.c#L129
  *     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: (NFINITY, INFINITY)
  *
  *  Codomain: (NFINITY, INFINITY)
  *
- *    Math.tan(5 * (Math::PI/2)) #=> 3266247870639074.0
+ *    Math.tan(0) #=> 0.0
  *
  */
 
@@ -418,21 +417,22 @@ math_exp(VALUE obj, VALUE x) https://github.com/ruby/ruby/blob/trunk/math.c#L417
 
 /*
  *  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
  *
  */
 
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 40851)
+++ ChangeLog	(revision 40852)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Mon May 20 19:33:55 2013  Benoit Daloze  <eregontp@g...>
+
+	* math.c: improve and fix documentation of sin, tan and log
+
 Mon May 20 19:31:49 2013  Benoit Daloze  <eregontp@g...>
 
 	* lib/logger.rb (Logger::Application): show namespace in documentation

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]