ruby-changes:12085
From: tadf <ko1@a...>
Date: Sat, 20 Jun 2009 08:57:55 +0900 (JST)
Subject: [ruby-changes:12085] Ruby:r23755 (trunk): * complex.c: edited rdoc.
tadf 2009-06-20 08:57:34 +0900 (Sat, 20 Jun 2009) New Revision: 23755 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=23755 Log: * complex.c: edited rdoc. * rational.c: ditto. * numeric.c: ditto. Modified files: trunk/ChangeLog trunk/complex.c trunk/numeric.c trunk/rational.c Index: complex.c =================================================================== --- complex.c (revision 23754) +++ complex.c (revision 23755) @@ -527,7 +527,7 @@ /* * call-seq: - * cmp.real => numeric + * cmp.real => real * * Returns the real part. */ @@ -540,8 +540,8 @@ /* * call-seq: - * cmp.imag => numeric - * cmp.imaginary => numeric + * cmp.imag => real + * cmp.imaginary => real * * Returns the imaginary part. */ @@ -793,9 +793,9 @@ /* * call-seq: - * cmp == numeric => true or false + * cmp == object => true or false * - * Returns true if cmp equals numeric numerically. + * Returns true if cmp equals object numerically. */ static VALUE nucomp_equal_p(VALUE self, VALUE other) @@ -843,7 +843,7 @@ /* * call-seq: - * cmp.abs2 => float + * cmp.abs2 => real * * Returns square of the absolute value. */ @@ -898,8 +898,8 @@ /* * call-seq: - * cmp.conj => numeric - * cmp.conjucate => numeric + * cmp.conj => complex + * cmp.conjucate => complex * * Returns the complex conjucate. */ @@ -949,7 +949,7 @@ /* * call-seq: - * cmp.denominator => numeric + * cmp.denominator => integer * * Returns the denominator. * @@ -1559,7 +1559,7 @@ /* * call-seq: - * num.abs2 => numeric + * num.abs2 => real * * Returns square of self. */ @@ -1573,11 +1573,11 @@ /* * call-seq: - * num.arg => numeric - * num.angle => numeric - * num.phase => numeric + * num.arg => float + * num.angle => float + * num.phase => float * - * Returns 0 if the value is positive otherwise pi. + * Returns 0 if the value is positive, pi otherwise. */ static VALUE numeric_arg(VALUE self) @@ -1625,14 +1625,14 @@ } /* - * Complex provides complex number class. - * it's so simple. it's not real. but really numeric. + * Complex provides complex number. + * it's simple. it's not real. but really numeric. * * Complex(0) #=> (0+0i) * Complex(1, 2) #=> (1+2i) * Complex.rect(1, 2) #=> (1+2i) * Complex(1.1, 3.3) #=> (1.1+3.3i) - * Complex(Rational(1, 2),Rational(2, 3)) + * Complex(Rational(1, 2), Rational(2, 3)) * #=> ((1/2)+(2/3)*i) * Complex.polar(1, 2) #=> (-0.4161468365471424+0.9092974268256817i) * Index: ChangeLog =================================================================== --- ChangeLog (revision 23754) +++ ChangeLog (revision 23755) @@ -1,3 +1,11 @@ +Sat Jun 20 08:56:47 2009 Tadayoshi Funaba <tadf@d...> + + * complex.c: edited rdoc. + + * rational.c: ditto. + + * numeric.c: ditto. + Sat Jun 20 07:17:52 2009 Yukihiro Matsumoto <matz@r...> * lib/monitor.rb (MonitorMixin::extend_object): should use Index: numeric.c =================================================================== --- numeric.c (revision 23754) +++ numeric.c (revision 23755) @@ -256,7 +256,7 @@ /* * call-seq: - * num.quo(numeric) => result + * num.quo(numeric) => real * * Returns most exact division (rational for integers, float for floats). */ @@ -355,7 +355,7 @@ /* * call-seq: - * num.modulo(numeric) => result + * num.modulo(numeric) => real * * x.modulo(y) means x-y*(x/y).floor * @@ -373,7 +373,7 @@ /* * call-seq: - * num.remainder(numeric) => result + * num.remainder(numeric) => real * * x.remainder(y) means x-y*(x/y).truncate * @@ -425,8 +425,8 @@ /* * call-seq: - * num.abs => num - * num.magnitude => num + * num.abs => numeric + * num.magnitude => numeric * * Returns the absolute value of <i>num</i>. * @@ -502,7 +502,7 @@ * * Document-class: Float * - * <code>Float</code> objects represent real numbers using the native + * <code>Float</code> objects represent inexact numbers using the native * architecture's double-precision floating point representation. */ @@ -804,7 +804,7 @@ * Raises <code>float</code> the <code>other</code> power. * * 2.0**3 #=> 8.0 - * (-8.0)**0.5 #=> NaN # try Complex(-8.0)**0.5 + * (-8.0)**0.5 #=> NaN # try (-8.0)**Complex(0.5) */ static VALUE @@ -934,10 +934,10 @@ /* * call-seq: - * flt <=> numeric => -1, 0, +1 + * flt <=> real => -1, 0, +1 * * Returns -1, 0, or +1 depending on whether <i>flt</i> is less than, - * equal to, or greater than <i>numeric</i>. This is the basis for the + * equal to, or greater than <i>real</i>. This is the basis for the * tests in <code>Comparable</code>. */ @@ -978,9 +978,9 @@ /* * call-seq: - * flt > other => true or false + * flt > real => true or false * - * <code>true</code> if <code>flt</code> is greater than <code>other</code>. + * <code>true</code> if <code>flt</code> is greater than <code>real</code>. */ static VALUE @@ -1016,10 +1016,10 @@ /* * call-seq: - * flt >= other => true or false + * flt >= real => true or false * * <code>true</code> if <code>flt</code> is greater than - * or equal to <code>other</code>. + * or equal to <code>real</code>. */ static VALUE @@ -1055,9 +1055,9 @@ /* * call-seq: - * flt < other => true or false + * flt < real => true or false * - * <code>true</code> if <code>flt</code> is less than <code>other</code>. + * <code>true</code> if <code>flt</code> is less than <code>real</code>. */ static VALUE @@ -1093,10 +1093,10 @@ /* * call-seq: - * flt <= other => true or false + * flt <= rael => true or false * * <code>true</code> if <code>flt</code> is less than - * or equal to <code>other</code>. + * or equal to <code>real</code>. */ static VALUE @@ -1800,12 +1800,12 @@ /* * call-seq: - * int.to_i => int - * int.to_int => int - * int.floor => int - * int.ceil => int - * int.round => int - * int.truncate => int + * int.to_i => integer + * int.to_int => integer + * int.floor => integer + * int.ceil => integer + * int.round => integer + * int.truncate => integer * * As <i>int</i> is already an <code>Integer</code>, all these * methods simply return the receiver. @@ -2329,8 +2329,8 @@ /* * call-seq: - * fix % other => numeric - * fix.modulo(other) => numeric + * fix % other => real + * fix.modulo(other) => real * * Returns <code>fix</code> modulo <code>other</code>. * See <code>numeric.divmod</code> for more information. @@ -2436,15 +2436,15 @@ /* * call-seq: - * fix ** other => numeric + * fix ** numeric => numeric_result * - * Raises <code>fix</code> to the <code>other</code> power, which may + * Raises <code>fix</code> to the <code>numeric</code> power, which may * be negative or fractional. * * 2 ** 3 #=> 8 * 2 ** -1 #=> 0.5 * 2 ** 0.5 #=> 1.4142135623731 - * (-8)**0.5 #=> NaN # try Complex(-8)**Rational(1,2) + * (-8)**0.5 #=> NaN # try (-8)**Complex(0.5) */ static VALUE @@ -2554,10 +2554,10 @@ /* * call-seq: - * fix > other => true or false + * fix > real => true or false * * Returns <code>true</code> if the value of <code>fix</code> is - * greater than that of <code>other</code>. + * greater than that of <code>real</code>. */ static VALUE @@ -2579,10 +2579,10 @@ /* * call-seq: - * fix >= other => true or false + * fix >= real => true or false * * Returns <code>true</code> if the value of <code>fix</code> is - * greater than or equal to that of <code>other</code>. + * greater than or equal to that of <code>real</code>. */ static VALUE @@ -2604,10 +2604,10 @@ /* * call-seq: - * fix < other => true or false + * fix < real => true or false * * Returns <code>true</code> if the value of <code>fix</code> is - * less than that of <code>other</code>. + * less than that of <code>real</code>. */ static VALUE @@ -2629,10 +2629,10 @@ /* * call-seq: - * fix <= other => true or false + * fix <= rael => true or false * * Returns <code>true</code> if the value of <code>fix</code> is - * less than or equal to that of <code>other</code>. + * less than or equal to that of <code>real</code>. */ static VALUE @@ -2682,7 +2682,7 @@ /* * call-seq: - * fix & other => integer + * fix & integer => integer_result * * Bitwise AND. */ @@ -2701,7 +2701,7 @@ /* * call-seq: - * fix | other => integer + * fix | integer => integer_result * * Bitwise OR. */ @@ -2720,7 +2720,7 @@ /* * call-seq: - * fix ^ other => integer + * fix ^ integer => integer_result * * Bitwise EXCLUSIVE OR. */ @@ -2868,8 +2868,8 @@ /* * call-seq: - * fix.abs => fix - * fix.magnitude => fix + * fix.abs => integer + * fix.magnitude => integer * * Returns the absolute value of <i>fix</i>. * Index: rational.c =================================================================== --- rational.c (revision 23754) +++ rational.c (revision 23755) @@ -1019,19 +1019,19 @@ /* * call-seq: - * rat == numeric => +true+ or +false+ + * rat == object => true or false * - * Tests for equality. Returns +true+ if _rat_ is equal to _numeric_; +false+ + * Tests for equality. Returns +true+ if _rat_ is equal to _object_; +false+ * otherwise. * * For example: * - * Rational(2, 3) == Rational(2, 3) #=> +true+ - * Rational(5) == 5 #=> +true+ - * Rational(7, 1) == Rational(7) #=> +true+ - * Rational(-2, 9) == Rational(-9, 2) #=> +false+ - * Rational(9, 8) == 4 #=> +false+ - * Rational(5, 3) == 'string' #=> +false+ + * Rational(2, 3) == Rational(2, 3) #=> true + * Rational(5) == 5 #=> true + * Rational(7, 1) == Rational(7) #=> true + * Rational(-2, 9) == Rational(-9, 2) #=> false + * Rational(9, 8) == 4 #=> false + * Rational(5, 3) == 'string' #=> false */ static VALUE nurat_equal_p(VALUE self, VALUE other) @@ -1121,8 +1121,8 @@ /* * call-seq: - * rat.modulo(numeric) => numeric - * rat % numeric => numeric + * rat.modulo(numeric) => real + * rat % numeric => real * * Returns the modulo of _rat_ and _numeric_ as a +Numeric+ object. * @@ -1152,8 +1152,9 @@ * call-seq: * rat.divmod(numeric) => array * - * Returns a two-element +Array+ containing the quotient and modulus obtained - * by dividing _rat_ by _numeric_. Both elements are +Numeric+. + * Returns a two-element +Array+ containing the quotient and modulus + * obtained by dividing _rat_ by _numeric_. The first element is + * an integer. The second selement is a real. * * A +ZeroDivisionError+ is raised if _numeric_ is 0. A +FloatDomainError+ is * raised if _numeric_ is 0.0. A +TypeError+ is raised unless _numeric_ is a @@ -1187,7 +1188,7 @@ /* * call-seq: - * rat.remainder(numeric) => numeric_result + * rat.remainder(numeric) => real * * Returns the remainder of dividing _rat_ by _numeric_ as a +Numeric+ object. * @@ -1327,7 +1328,7 @@ /* * call-seq: * rat.floor => integer - * rat.floor(precision=0) => numeric + * rat.floor(precision=0) => rational * * Returns the largest integer less than or equal to _rat_ as an +Integer+ * object. Contrast with +Rational#ceil+. @@ -1362,7 +1363,7 @@ /* * call-seq: * rat.ceil => integer - * rat.ceil(precision=0) => numeric + * rat.ceil(precision=0) => rational * * Returns the smallest integer greater than or equal to _rat_ as an +Integer+ * object. Contrast with +Rational#floor+. @@ -1397,7 +1398,7 @@ /* * call-seq: * rat.truncate => integer - * rat.truncate(precision=0) => numeric + * rat.truncate(precision=0) => rational * * Truncates self to an integer and returns the result as an +Integer+ object. * @@ -1431,7 +1432,7 @@ /* * call-seq: * rat.round => integer - * rat.round(precision=0) => numeric + * rat.round(precision=0) => rational * * Rounds _rat_ to an integer, and returns the result as an +Integer+ object. * @@ -1799,13 +1800,9 @@ /* * call-seq: - * nil.to_r => Rational(0, 1) + * nil.to_r => (0/1) * * Returns a +Rational+ object representing _nil_ as a rational number. - * - * For example: - * - * nil.to_r #=> (0/1) */ static VALUE nilclass_to_r(VALUE self) @@ -2139,7 +2136,7 @@ * Rational(0.5) #=> (1/2) * Rational("2/7") #=> (2/7) * Rational("0.25") #=> (1/4) - * Rational(10e3) #=> (10000/1) + * Rational("10e3") #=> (10000/1) * * The first argument is the numerator, the second the denominator. If the * denominator is not supplied it defaults to 1. The arguments can be -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/