summaryrefslogtreecommitdiff
path: root/complex.c
diff options
context:
space:
mode:
authortadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-05 11:44:34 +0000
committertadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-05 11:44:34 +0000
commit5a763bb525d3d0d51e4f2ea0da4a3fa514656a4a (patch)
tree561b7c3c81a1d0196c3d7eaa65779aaa8e9fbbea /complex.c
parentb35d1e714c1df44b5346e35a6dc519da5e8de4d5 (diff)
downloadruby-5a763bb525d3d0d51e4f2ea0da4a3fa514656a4a.tar.gz
* complex.c (float_arg): returns PI for -0.0.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23960 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'complex.c')
-rw-r--r--complex.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/complex.c b/complex.c
index 048aa92bfd..d64c628128 100644
--- a/complex.c
+++ b/complex.c
@@ -1756,7 +1756,9 @@ float_arg(VALUE self)
{
if (isnan(RFLOAT_VALUE(self)))
return self;
- return rb_call_super(0, 0);
+ if (f_tpositive_p(self))
+ return INT2FIX(0);
+ return rb_const_get(rb_mMath, id_PI);
}
/*