diff options
author | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-11-23 14:28:55 +0000 |
---|---|---|
committer | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-11-23 14:28:55 +0000 |
commit | 4ffe7a1734ad9eea45c230931fc1f2a3880d7b36 (patch) | |
tree | 040e3bc86b8cc877672e90e758a65469b0b61153 | |
parent | 16cb5ce483b87646258e0c10fbda4520a0faf343 (diff) |
modified some descriptions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29887 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | complex.c | 4 | ||||
-rw-r--r-- | rational.c | 18 |
2 files changed, 11 insertions, 11 deletions
@@ -1077,7 +1077,7 @@ extern VALUE rb_lcm(VALUE x, VALUE y); * call-seq: * cmp.denominator -> integer * - * Returns the denominator (lcm of both denominator, real and imag). + * Returns the denominator (lcm of both denominator - real and imag). * * See numerator. */ @@ -1646,7 +1646,7 @@ nucomp_s_convert(int argc, VALUE *argv, VALUE klass) if (argc == 1) { if (k_numeric_p(a1) && !f_real_p(a1)) return a1; - /* expect raise exception for consistency */ + /* should raise exception for consistency */ if (!k_numeric_p(a1)) return rb_convert_type(a1, T_COMPLEX, "Complex", "to_c"); } diff --git a/rational.c b/rational.c index 2aec3e264a..c795af1fed 100644 --- a/rational.c +++ b/rational.c @@ -667,7 +667,7 @@ f_addsub(VALUE self, VALUE anum, VALUE aden, VALUE bnum, VALUE bden, int k) /* * call-seq: - * rat + numeric -> numeric_result + * rat + numeric -> numeric * * Performs addition. * @@ -709,7 +709,7 @@ nurat_add(VALUE self, VALUE other) /* * call-seq: - * rat - numeric -> numeric_result + * rat - numeric -> numeric * * Performs subtraction. * @@ -790,7 +790,7 @@ f_muldiv(VALUE self, VALUE anum, VALUE aden, VALUE bnum, VALUE bden, int k) /* * call-seq: - * rat * numeric -> numeric_result + * rat * numeric -> numeric * * Performs multiplication. * @@ -832,8 +832,8 @@ nurat_mul(VALUE self, VALUE other) /* * call-seq: - * rat / numeric -> numeric_result - * rat.quo(numeric) -> numeric_result + * rat / numeric -> numeric + * rat.quo(numeric) -> numeric * * Performs division. * @@ -913,7 +913,7 @@ nurat_fdiv(VALUE self, VALUE other) /* * call-seq: - * rat ** numeric -> numeric_result + * rat ** numeric -> numeric * * Performs exponentiation. * @@ -1145,7 +1145,6 @@ nurat_ceil(VALUE self) return f_negate(f_idiv(f_negate(dat->num), dat->den)); } - /* * call-seq: * rat.to_i -> integer @@ -2224,8 +2223,8 @@ nurat_s_convert(int argc, VALUE *argv, VALUE klass) * a/b (b>0). Where a is numerator and b is denominator. Integer a * equals rational a/1 mathematically. * - * In ruby, you can create rational object with Rational or to_r - * method. The return values will be irreducible. + * In ruby, you can create rational object with Rational, to_r or + * rationalize method. The return values will be irreducible. * * Rational(1) #=> (1/1) * Rational(2, 3) #=> (2/3) @@ -2242,6 +2241,7 @@ nurat_s_convert(int argc, VALUE *argv, VALUE klass) * 0.3.to_r #=> (5404319552844595/18014398509481984) * '0.3'.to_r #=> (3/10) * '2/3'.to_r #=> (2/3) + * 0.3.rationalize #=> (3/10) * * A rational object is an exact number, which helps you to write * program without any rounding errors. |