diff options
author | nagachika <nagachika@ruby-lang.org> | 2021-03-20 15:35:30 +0900 |
---|---|---|
committer | nagachika <nagachika@ruby-lang.org> | 2021-03-20 15:35:30 +0900 |
commit | 82bce422ba9e131e62b528854dea69a6e8cc0c04 (patch) | |
tree | cf44dea8aaa0f021c4fcf97990ce28d43de8cd35 /internal.h | |
parent | c02f4c1c5aa5056d6eae8f0c2d6414adf5293b2b (diff) |
merge revision(s) 254bed302752a401b5fcc3b6c65a9c93711d91d6,fad3023e94c45e7f03478732f7641b6f39ba9d12,3156fb0f2c3ebf8229f392c8502c08fe165ab181: [Backport #17218]
Renamed `nurat_sub` compliant with `rb_rational_plus`
---
internal/rational.h | 1 +
rational.c | 6 +++---
2 files changed, 4 insertions(+), 3 deletions(-)
Fix ArithmeticSequence#last and ArithmeticSequence#each for
non-integer sequences (#3870)
[Bug #17218]
[ruby-core:100312]
---
common.mk | 2 +
enumerator.c | 99 ++++++++++++++++++++++++++++++++---
internal/numeric.h | 2 +
internal/rational.h | 2 +
numeric.c | 53 ++++++++++---------
rational.c | 28 +++++++---
test/ruby/test_arithmetic_sequence.rb | 10 ++++
7 files changed, 156 insertions(+), 40 deletions(-)
test/ruby/test_arithmetic_sequence.rb: remove a duplicated test
There is another "test_last_bug17218"
---
test/ruby/test_arithmetic_sequence.rb | 5 -----
1 file changed, 5 deletions(-)
Diffstat (limited to 'internal.h')
-rw-r--r-- | internal.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/internal.h b/internal.h index b96c152252..47428da27f 100644 --- a/internal.h +++ b/internal.h @@ -1812,6 +1812,7 @@ VALUE rb_float_uminus(VALUE num); VALUE rb_int_plus(VALUE x, VALUE y); VALUE rb_float_plus(VALUE x, VALUE y); VALUE rb_int_minus(VALUE x, VALUE y); +VALUE rb_float_minus(VALUE x, VALUE y); VALUE rb_int_mul(VALUE x, VALUE y); VALUE rb_float_mul(VALUE x, VALUE y); VALUE rb_float_div(VALUE x, VALUE y); @@ -1840,6 +1841,7 @@ int rb_int_positive_p(VALUE num); int rb_int_negative_p(VALUE num); VALUE rb_num_pow(VALUE x, VALUE y); VALUE rb_float_ceil(VALUE num, int ndigits); +VALUE rb_float_floor(VALUE x, int ndigits); static inline VALUE rb_num_compare_with_zero(VALUE num, ID mid) @@ -2096,13 +2098,16 @@ void rb_last_status_clear(void); VALUE rb_rational_canonicalize(VALUE x); VALUE rb_rational_uminus(VALUE self); VALUE rb_rational_plus(VALUE self, VALUE other); +VALUE rb_rational_minus(VALUE self, VALUE other); VALUE rb_rational_mul(VALUE self, VALUE other); +VALUE rb_rational_div(VALUE self, VALUE other); VALUE rb_lcm(VALUE x, VALUE y); 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_rational_floor(VALUE self, int ndigits); VALUE rb_numeric_quo(VALUE x, VALUE y); VALUE rb_float_numerator(VALUE x); VALUE rb_float_denominator(VALUE x); |