* rational.c (nurat_abs); removed.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23751 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
tadf 2009-06-19 19:31:41 +00:00
Родитель 64eccf4d6b
Коммит c21b9570dc
2 изменённых файлов: 4 добавлений и 25 удалений

Просмотреть файл

@ -1,3 +1,7 @@
Sat Jun 20 04:30:35 2009 Tadayoshi Funaba <tadf@dotrb.org>
* rational.c (nurat_abs); removed.
Sat Jun 20 03:34:16 2009 Tadayoshi Funaba <tadf@dotrb.org>
* complex.c: added rdoc.

Просмотреть файл

@ -1243,29 +1243,6 @@ nurat_quotrem(VALUE self, VALUE other)
}
#endif
/*
* call-seq:
* rat.abs => rational
*
* Returns the absolute value of _rat_. If _rat_ is positive, it is
* returned; if _rat_ is negative its negation is returned. The return value
* is a +Rational+ object.
*
* For example:
*
* Rational(2).abs #=> (2/1)
* Rational(-2).abs #=> (2/1)
* Rational(-8, -1).abs #=> (8/1)
* Rational(-20, 7).abs #=> (20/7)
*/
static VALUE
nurat_abs(VALUE self)
{
if (f_positive_p(self))
return self;
return f_negate(self);
}
#if 0
/* :nodoc: */
static VALUE
@ -2298,8 +2275,6 @@ Init_Rational(void)
rb_define_method(rb_cRational, "quotrem", nurat_quotrem, 1);
#endif
rb_define_method(rb_cRational, "abs", nurat_abs, 0);
#if 0
rb_define_method(rb_cRational, "rational?", nurat_true, 0);
rb_define_method(rb_cRational, "exact?", nurat_true, 0);