summaryrefslogtreecommitdiff
path: root/internal.h
diff options
context:
space:
mode:
authormrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-18 15:17:19 +0000
committermrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-18 15:17:19 +0000
commitc151aa88a97d5f3a95c77e7de5db87b7acec16bb (patch)
tree523f90b6abc0ba5848552494e1efb1fb3ebbcbbf /internal.h
parent632622731722133bbbad7e65878a6cbbb228c5a3 (diff)
complex.c: optimize f_negate
* complex.c (f_negate): optimize for special numeric types. * complex.c (nucomp_expt): use rb_int_uminus instead of f_negate for fixnum value. * internal.h (rb_float_uminus, rb_rational_uminus): exported. * numeric.c (rb_float_uminus): rename from flo_uminus. * rational.c (rb_rational_uminus): rename from nurat_negate, and add assertion for the parameter. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56830 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'internal.h')
-rw-r--r--internal.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/internal.h b/internal.h
index 31bfbeb8ab..153b9e02e8 100644
--- a/internal.h
+++ b/internal.h
@@ -1168,6 +1168,7 @@ int rb_num_negative_p(VALUE);
VALUE rb_int_succ(VALUE num);
VALUE rb_int_pred(VALUE num);
VALUE rb_int_uminus(VALUE num);
+VALUE rb_float_uminus(VALUE num);
VALUE rb_int_plus(VALUE x, VALUE y);
VALUE rb_int_minus(VALUE x, VALUE y);
VALUE rb_int_mul(VALUE x, VALUE y);
@@ -1378,6 +1379,7 @@ rb_pid_t rb_fork_ruby(int *status);
void rb_last_status_clear(void);
/* rational.c */
+VALUE rb_rational_uminus(VALUE self);
VALUE rb_rational_plus(VALUE self, VALUE other);
VALUE rb_lcm(VALUE x, VALUE y);
VALUE rb_rational_reciprocal(VALUE x);