diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-10-20 02:49:18 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-10-20 02:49:18 +0000 |
commit | b4bbfe4bb91db310d903a149cfa5525295e4a70c (patch) | |
tree | f4238c1cbdc236dc5f5ee2d16661f0fa22449f7a /internal.h | |
parent | c561284bc258dee0d3410f102573d768f6365f88 (diff) |
complex.c: small optimization of Complex#**
* complex.c (rb_complex_pow): calculate power of a Fixnum without
allocating intermediate Complex objects, and avoid unexpected
NaNs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65190 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'internal.h')
-rw-r--r-- | internal.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/internal.h b/internal.h index b55121fbc7..f6fcd399b7 100644 --- a/internal.h +++ b/internal.h @@ -1174,6 +1174,7 @@ VALUE rb_complex_mul(VALUE, VALUE); VALUE rb_complex_abs(VALUE x); VALUE rb_complex_sqrt(VALUE x); VALUE rb_dbl_complex_polar(double abs, double ang); +VALUE rb_complex_pow(VALUE self, VALUE other); /* cont.c */ VALUE rb_obj_is_fiber(VALUE); @@ -1471,6 +1472,7 @@ VALUE rb_int_abs(VALUE num); VALUE rb_int_odd_p(VALUE num); int rb_int_positive_p(VALUE num); int rb_int_negative_p(VALUE num); +VALUE rb_num_pow(VALUE x, VALUE y); static inline VALUE rb_num_compare_with_zero(VALUE num, ID mid) @@ -1735,6 +1737,7 @@ VALUE rb_rational_reciprocal(VALUE x); VALUE rb_cstr_to_rat(const char *, int); VALUE rb_rational_abs(VALUE self); VALUE rb_rational_cmp(VALUE self, VALUE other); +VALUE rb_rational_pow(VALUE self, VALUE other); VALUE rb_numeric_quo(VALUE x, VALUE y); /* re.c */ |