summaryrefslogtreecommitdiff
path: root/rational.c
diff options
context:
space:
mode:
authortadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-06-19 19:31:41 (GMT)
committertadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-06-19 19:31:41 (GMT)
commitc21b9570dc93293a80f1ff99db36c518ffdd9cb7 (patch)
tree51019efe3ea818a3fa8d58be9040cf82480e2b34 /rational.c
parent64eccf4d6b0b54bf192a10ed821c406ce39c809d (diff)
* rational.c (nurat_abs); removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23751 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'rational.c')
-rw-r--r--rational.c25
1 files changed, 0 insertions, 25 deletions
diff --git a/rational.c b/rational.c
index 4e0d7d6..2aed3f2 100644
--- a/rational.c
+++ b/rational.c
@@ -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);