diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-05-17 06:53:48 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-05-17 06:53:48 +0000 |
commit | 0362ad83a7c1852d638915859ca56f49d39fb8ac (patch) | |
tree | bdf433b181c6d6e00bd33581136ab2970bc9509d /lib | |
parent | 314346ad7b7248421af13633ad1bdec704799afe (diff) | |
download | ruby-0362ad83a7c1852d638915859ca56f49d39fb8ac.tar.gz |
[Feature #12005] Unify Fixnum and Bignum into Integer
* [Feature #12005] Unify Fixnum and Bignum into Integer
* include/ruby/ruby.h (rb_class_of): Return rb_cInteger for fixnums.
* insns.def (INTEGER_REDEFINED_OP_FLAG): Unified from
FIXNUM_REDEFINED_OP_FLAG and BIGNUM_REDEFINED_OP_FLAG.
* vm_core.h: Ditto.
* vm_insnhelper.c (opt_eq_func): Use INTEGER_REDEFINED_OP_FLAG instead
of FIXNUM_REDEFINED_OP_FLAG.
* vm.c (vm_redefinition_check_flag): Use rb_cInteger instead of
rb_cFixnum and rb_cBignum.
(C): Use Integer instead of Fixnum and Bignum.
* numeric.c (fix_succ): Removed.
(Init_Numeric): Define Fixnum as Integer.
* bignum.c (bignew): Use rb_cInteger instead of Rb_cBignum.
(rb_int_coerce): replaced from rb_big_coerce and return fixnums
as-is.
(Init_Bignum): Define Bignum as Integer.
Don't define ===.
* error.c (builtin_class_name): Return "Integer" for fixnums.
* sprintf.c (ruby__sfvextra): Use rb_cInteger instead of rb_cFixnum.
* ext/-test-/testutil: New directory to test.
Currently it provides utilities for fixnum and bignum.
* ext/json/generator/generator.c: Define mInteger_to_json.
* lib/mathn.rb (Fixnum#/): Redefinition removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/mathn.rb | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/lib/mathn.rb b/lib/mathn.rb index 9e33f45580..d6f2da0210 100644 --- a/lib/mathn.rb +++ b/lib/mathn.rb @@ -55,27 +55,12 @@ unless defined?(Math.exp!) end ## -# When mathn is required, Fixnum's division is enhanced to +# When mathn is required, Integer's division is enhanced to # return more precise values from mathematical expressions. # # 2/3*3 # => 0 # require 'mathn' # 2/3*3 # => 2 - -class Fixnum - remove_method :/ - - ## - # +/+ defines the Rational division for Fixnum. - # - # 1/3 # => (1/3) - - alias / quo -end - -## -# When mathn is required Bignum's division is enhanced to -# return more precise values from mathematical expressions. # # (2**72) / ((2**70) * 3) # => 4/3 |