mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* numeric.c (int_to_s): Move from flo_to_s.
* numeric.c (Integer#to_s): Move from Fixnum#to_s. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54175 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
54c7712081
commit
a22ff208e5
2 changed files with 11 additions and 6 deletions
|
@ -1,3 +1,9 @@
|
|||
Fri Mar 18 21:30:00 2016 Kenta Murata <mrkn@mrkn.jp>
|
||||
|
||||
* numeric.c (int_to_s): Move from flo_to_s.
|
||||
|
||||
* numeric.c (Integer#to_s): Move from Fixnum#to_s.
|
||||
|
||||
Fri Mar 18 16:22:24 2016 Victor Nawothnig <Victor.Nawothnig@gmail.com>
|
||||
|
||||
* parse.y (parse_numvar): NTH_REF must be less than a half of
|
||||
|
|
11
numeric.c
11
numeric.c
|
@ -2948,9 +2948,9 @@ rb_fix2str(VALUE x, int base)
|
|||
|
||||
/*
|
||||
* call-seq:
|
||||
* fix.to_s(base=10) -> string
|
||||
* int.to_s(base=10) -> string
|
||||
*
|
||||
* Returns a string containing the representation of +fix+ radix +base+
|
||||
* Returns a string containing the representation of +int+ radix +base+
|
||||
* (between 2 and 36).
|
||||
*
|
||||
* 12345.to_s #=> "12345"
|
||||
|
@ -2962,7 +2962,7 @@ rb_fix2str(VALUE x, int base)
|
|||
*
|
||||
*/
|
||||
static VALUE
|
||||
fix_to_s(int argc, VALUE *argv, VALUE x)
|
||||
int_to_s(int argc, VALUE *argv, VALUE x)
|
||||
{
|
||||
int base;
|
||||
|
||||
|
@ -4185,6 +4185,8 @@ Init_Numeric(void)
|
|||
rb_undef_alloc_func(rb_cInteger);
|
||||
rb_undef_method(CLASS_OF(rb_cInteger), "new");
|
||||
|
||||
rb_define_method(rb_cInteger, "to_s", int_to_s, -1);
|
||||
rb_define_alias(rb_cInteger, "inspect", "to_s");
|
||||
rb_define_method(rb_cInteger, "integer?", int_int_p, 0);
|
||||
rb_define_method(rb_cInteger, "odd?", int_odd_p, 0);
|
||||
rb_define_method(rb_cInteger, "even?", int_even_p, 0);
|
||||
|
@ -4205,9 +4207,6 @@ Init_Numeric(void)
|
|||
|
||||
rb_cFixnum = rb_define_class("Fixnum", rb_cInteger);
|
||||
|
||||
rb_define_method(rb_cFixnum, "to_s", fix_to_s, -1);
|
||||
rb_define_alias(rb_cFixnum, "inspect", "to_s");
|
||||
|
||||
rb_define_method(rb_cFixnum, "-@", fix_uminus, 0);
|
||||
rb_define_method(rb_cFixnum, "+", fix_plus, 1);
|
||||
rb_define_method(rb_cFixnum, "-", fix_minus, 1);
|
||||
|
|
Loading…
Add table
Reference in a new issue