nobu
88cc25f96d
missing.h: isfinite
...
* include/ruby/missing.h (isfinite): move from numeric.c.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55136 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-23 12:33:39 +00:00
nobu
4a9705d6e3
ruby.h: RB_INTEGER_TYPE_P
...
* include/ruby/ruby.h (RB_INTEGER_TYPE_P): new macro and
underlying inline function to check if the object is an
Integer (Fixnum or Bignum).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-18 01:17:43 +00:00
mrkn
d5595a9627
Optimize enum_sum for a range from int to int
...
* enum.c (enum_sum): Optimize for a range from int to int.
* test/ruby/test_enum.rb (test_range_sum): Move from test_range.rb,
and add assertions for some conditions.
* test/ruby/test_enum.rb (test_hash_sum): Move from test_hash.rb.
* test/ruby/test_hash.rb, test/ruby/test_range.rb: Remove test_sum.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55034 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-17 15:08:33 +00:00
akr
449fbfd4d4
Use Integer instead of Fixnum and Bignum.
...
* object.c, numeric.c, enum.c, ext/-test-/bignum/mul.c,
lib/rexml/quickpath.rb, lib/rexml/text.rb, lib/rexml/xpath_parser.rb,
lib/rubygems/specification.rb, lib/uri/generic.rb,
bootstraptest/test_eval.rb, basictest/test.rb,
test/-ext-/bignum/test_big2str.rb, test/-ext-/bignum/test_div.rb,
test/-ext-/bignum/test_mul.rb, test/-ext-/bignum/test_str2big.rb,
test/csv/test_data_converters.rb, test/date/test_date.rb,
test/json/test_json_generate.rb, test/minitest/test_minitest_mock.rb,
test/openssl/test_cipher.rb, test/rexml/test_jaxen.rb,
test/ruby/test_array.rb, test/ruby/test_basicinstructions.rb,
test/ruby/test_bignum.rb, test/ruby/test_case.rb,
test/ruby/test_class.rb, test/ruby/test_complex.rb,
test/ruby/test_enum.rb, test/ruby/test_eval.rb,
test/ruby/test_iseq.rb, test/ruby/test_literal.rb,
test/ruby/test_math.rb, test/ruby/test_module.rb,
test/ruby/test_numeric.rb, test/ruby/test_range.rb,
test/ruby/test_rational.rb, test/ruby/test_refinement.rb,
test/ruby/test_rubyvm.rb, test/ruby/test_struct.rb,
test/ruby/test_variable.rb, test/rubygems/test_gem_specification.rb,
test/thread/test_queue.rb: Use Integer instead of Fixnum and Bignum.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55029 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-17 13:15:57 +00:00
akr
f9727c12cc
[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
2016-05-17 06:53:48 +00:00
nobu
da696ae794
drop FreeBSD < 4 support
...
* NEWS: drop FreeBSD < 4 support.
The most recent version affected by this is 3.5 and was released
in 2000.
https://www.freebsd.org/releases/3.5R/announce.html
https://en.wikipedia.org/wiki/History_of_FreeBSD#Version_history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54992 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-12 23:46:43 +00:00
naruse
a6c8e8d15b
* configure.in: add -Wsuggest-attribute=noreturn and suppress warnings.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-08 00:55:28 +00:00
yui-knk
903161e0af
numeric.c: Remove prototype declarations to internal.h
...
* numeric.c (fix_plus): Remove rb_nucomp_add prototype
declaration.
* numeric.c (fix_mul): Remove rb_nucomp_mul prototype
declaration.
* internal.h (rb_nucomp_add, rb_nucomp_mul): add prototype
declarations.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-04 14:12:10 +00:00
kazu
8ef6dacb24
Update result of 123456789 ** -2
...
* numeric.c: [DOC] Update result of 123456789 ** -2.
[ruby-dev:49606] [Bug #12339 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54898 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-03 14:31:40 +00:00
kazu
77a99fd4d5
Update rdoc of Integer#modulo [ci skip]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-02 11:46:02 +00:00
akr
396d835d09
[DOC] merge documents for {Integer,Fixnum}#succ.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-01 01:35:43 +00:00
akr
c19c8ef4ae
[DOC]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54853 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-30 13:05:22 +00:00
akr
6b6fa21031
Gather Fixnum method definitions.
...
* numeric.c (Init_Numeric): Gather Fixnum method definitions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-30 12:55:59 +00:00
akr
8248c26e6d
Define Integer#/ instead of Bignum#/.
...
* numeric.c (rb_int_div): Define Integer#/.
* bignum.c (rb_big_div): Don't define Bignum#/.
* lib/mathn.rb (Integer#/): Replace Integer#/ instead of Bignum#/.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54851 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-30 12:39:53 +00:00
akr
d0e2d150b8
Define Integer#+ instead of Bignum#+.
...
* numeric.c (rb_int_plus): Define Integer#+.
* bignum.c (rb_big_plus): Don't define Bignum#+.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54850 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-30 12:24:06 +00:00
akr
11ca96d3a3
Define Integer#- instead of Bignum#-.
...
* numeric.c (rb_int_minus): Define Integer#-.
* bignum.c (rb_big_minus): Don't define Bignum#-.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-30 12:09:31 +00:00
akr
a9f3a1cda1
Define Integer#* instead of Bignum#*.
...
* numeric.c (rb_int_mul): Define Integer#*.
* bignum.c (rb_big_mul): Don't define Bignum#*.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-30 11:54:26 +00:00
akr
e27a06f4bb
Define Integer#% instead of Bignum#%.
...
* numeric.c (rb_int_modulo): Define Integer#%.
* bignum.c (rb_big_modulo): Don't define Bignum#%.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54847 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-30 11:31:28 +00:00
akr
25f2c85066
Define Integer#== instead of Bignum#==.
...
* numeric.c (int_equal): Define Integer#==.
* bignum.c (rb_big_eq): Don't define Bignum#==.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-30 11:18:00 +00:00
akr
70279a5700
Define Integer#> instead of Bignum#>.
...
* numeric.c (int_gt): Define Integer#>.
* bignum.c (rb_big_gt): Don't define Bignum#>.
Renamed from big_gt.
* internal.h (rb_big_gt): Declared.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54845 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-30 10:42:06 +00:00
akr
289c3f40a1
Define Integer#>= instead of Bignum#>=.
...
* numeric.c (int_ge): Define Integer#>=.
* bignum.c (rb_big_ge): Don't define Bignum#>=.
Renamed from big_ge.
* internal.h (rb_big_ge): Declared.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54844 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-30 10:26:17 +00:00
akr
6b16db9c80
Define Integer#< instead of Bignum#<.
...
* numeric.c (int_lt): Define Integer#<.
* bignum.c (rb_big_lt): Don't define Bignum#<.
Renamed from big_lt.
* internal.h (rb_big_lt): Declared.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-30 10:10:23 +00:00
akr
d00bca92a9
Define Integer#<= instead of Bignum#<=.
...
* numeric.c (int_le): Define Integer#<=.
* bignum.c (rb_big_le): Don't define Bignum#<=.
Renamed from big_le.
* internal.h (rb_big_le): Declared.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54841 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-30 09:48:25 +00:00
akr
11678caa34
Define Integer#-@ instead of Fixnum#-@.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54839 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-30 08:52:49 +00:00
akr
635cff451f
Define Integer#remainder instead of Bignum#remainder.
...
* numeric.c (int_remainder): Define Integer#remainder.
* bignum.c (rb_big_remainder): Don't define Bignum#remainder.
* internal.h (rb_big_remainder): Declared.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54838 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-30 08:27:30 +00:00
akr
ae225a2ca8
{Fixnum,Bignum}#-@ is unified into Integer.
...
* numeric.c (rb_int_uminus): {Fixnum,Bignum}#-@ is unified into
Integer.
* bignum.c (rb_big_uminus): Don't define Bignum#-@.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54837 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-30 06:30:08 +00:00
akr
73dd745cf1
{Fixnum,Bignum}#div is unified into Integer.
...
* numeric.c (rb_int_idiv): {Fixnum,Bignum}#div is unified into
Integer.
* bignum.c (rb_big_idiv): Don't define Bignum#div.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54836 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-30 05:43:15 +00:00
akr
728333dcd3
{Fixnum,Bignum}#modulo is unified into Integer.
...
* numeric.c (rb_int_modulo): {Fixnum,Bignum}#modulo is unified into
Integer.
* bignum.c (rb_big_modulo): Don't define Bignum#modulo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-30 05:26:52 +00:00
akr
1b1a1ed6c8
{Fixnum,Bignum}#divmod is unified into Integer.
...
* numeric.c (int_divmod): {Fixnum,Bignum}#divmod is unified into
Integer.
* bignum.c (rb_big_divmod): Don't define Bignum#divmod.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54834 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-30 05:05:54 +00:00
akr
bda463c134
move Fixnum#/ document position.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-30 04:22:27 +00:00
akr
27f9556de9
{Fixnum,Bignum}#fdiv is unified into Integer.
...
* numeric.c (int_fdiv): {Fixnum,Bignum}#fdiv is unified into
Integer.
* bignum.c (rb_big_fdiv): Don't define Bignum#fdiv.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-30 04:20:56 +00:00
akr
8a2df1ce3f
{Fixnum,Bignum}#** is unified into Integer.
...
* numeric.c (rb_int_pow): {Fixnum,Bignum}#** is unified into
Integer.
* bignum.c (rb_big_pow): Don't define Bignum#**.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-30 03:59:02 +00:00
akr
d73b431e50
Rename fix_rev and rb_big_neg to fix_comp and rb_big_comp.
...
* bignum.c (rb_big_comp): Renamed from rb_big_neg.
* numeric.c (fix_comp): Renamed from fix_rev.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54830 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-30 03:30:53 +00:00
akr
10fb4e151d
{Fixnum,Bignum}#~ is unified into Integer.
...
* numeric.c (int_comp): {Fixnum,Bignum}#~ is unified into
Integer.
* bignum.c (rb_big_neg): Don't define Bignum#~.
* internal.h (rb_big_neg): Declared.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54829 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-30 03:27:20 +00:00
akr
b296cacb12
{Fixnum,Bignum}#& is unified into Integer.
...
* numeric.c (int_and): {Fixnum,Bignum}#& is unified into
Integer.
* bignum.c (rb_big_and): Don't define Bignum#|.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54828 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-30 03:08:53 +00:00
akr
44af023d44
{Fixnum,Bignum}#| is unified into Integer.
...
* numeric.c (int_or): {Fixnum,Bignum}#| is unified into
Integer.
* bignum.c (rb_big_or): Don't define Bignum#|.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-30 02:54:14 +00:00
akr
f949a95dab
{Fixnum,Bignum}#^ is unified into Integer.
...
* numeric.c (int_xor): {Fixnum,Bignum}#^ is unified into
Integer.
* bignum.c (rb_big_xor): Don't define Bignum#^.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-27 15:35:23 +00:00
akr
c71e02bd07
[Doc] Add Document-method: directives.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-27 13:05:09 +00:00
kazu
b530f58647
Update rdoc of Integer#[] (fix -> int)
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54797 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-27 12:59:59 +00:00
akr
02107a91c8
[DOC] move rdoc comments.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-27 12:46:46 +00:00
akr
d5a7299bca
{Fixnum,Bignum}#[] is unified into Integer.
...
* numeric.c (int_aref): {Fixnum,Bignum}#[] is unified into
Integer.
* bignum.c (rb_big_aref): Don't define Bignum#<<.
* internal.h (rb_big_aref): Declared.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-27 11:56:03 +00:00
akr
68c661b8e5
[DOC] update Integer#<< doc.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-26 12:29:41 +00:00
akr
06ca50338b
{Fixnum,Bignum}#<< is unified into Integer.
...
* numeric.c (rb_int_lshift): {Fixnum,Bignum}#<< is unified into
Integer.
* bignum.c (rb_big_lshift): Don't define Bignum#<<.
* internal.h (rb_big_lshift): Declared.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-26 12:23:05 +00:00
akr
69fbb21c12
{Fixnum,Bignum}#>> is unified into Integer.
...
* numeric.c (rb_int_rshift): {Fixnum,Bignum}#>> is unified into
Integer.
* bignum.c (rb_big_rshift): Don't define Bignum#>>.
* internal.h (rb_big_rshift): Declared.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-26 12:09:40 +00:00
akr
8f045eddb2
{Fixnum,Bignum}#size is unified into Integer.
...
* numeric.c (int_size): {Fixnum,Bignum}#size is unified into Integer.
* bignum.c (rb_big_size_m): Don't define Bignum#size.
* internal.h (rb_big_size_m): Declared.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54780 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-26 11:47:14 +00:00
akr
bcc1796983
{Fixnum,Bignum}#bit_length is unified into Integer.
...
* numeric.c (rb_int_bit_length): {Fixnum,Bignum}#bit_length is
unified into Integer.
* bignum.c (rb_big_bit_length): Don't define Bignum#bit_length.
* internal.h (rb_big_bit_length): Declared.
--This iine, and those below, will be ignored--
M ChangeLog
M bignum.c
M internal.h
M numeric.c
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-26 11:17:37 +00:00
akr
9368d7515b
* numeric.c (int_abs): Integer#{abs,magnitude} moved from Fixnum and Bignum.
...
* internal.h (rb_big_abs): Declared.
* bignum.c (rb_big_abs): Don't define Bignum#{abs,magnitude}.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-26 10:59:27 +00:00
nobu
0a38e38aea
numeric.c: numeric ndigits
...
* numeric.c (num_floor, num_ceil, num_truncate): add an optional
parameter, digits, as well as Numeric#round. [Feature #12245 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54626 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-18 03:57:34 +00:00
nobu
fe96a2495c
numeric.c: flo_truncate
...
* numeric.c (flo_truncate): add an optional parameter, digits, as
well as Float#round. [Feature #12245 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-18 03:56:33 +00:00
nobu
39f31b8c87
numeric.c: int_truncate
...
* numeric.c (int_truncate): add an optional parameter, digits, as
well as Integer#round. [Feature #12245 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54624 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-18 03:55:33 +00:00