aboutsummaryrefslogtreecommitdiffstats
path: root/numeric.c
Commit message (Collapse)AuthorAgeFilesLines
* * configure.in: add -Wsuggest-attribute=noreturn and suppress warnings.naruse2016-05-081-1/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c: Remove prototype declarations to internal.hyui-knk2016-05-041-2/+0
| | | | | | | | | | | | | * 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
* Update result of 123456789 ** -2kazu2016-05-031-1/+1
| | | | | | | * 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
* Update rdoc of Integer#modulo [ci skip]kazu2016-05-021-3/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* [DOC] merge documents for {Integer,Fixnum}#succ.akr2016-05-011-11/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* [DOC]akr2016-04-301-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54853 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Gather Fixnum method definitions.akr2016-04-301-14/+16
| | | | | | | | * 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
* Define Integer#/ instead of Bignum#/.akr2016-04-301-1/+15
| | | | | | | | | | | | * 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
* Define Integer#+ instead of Bignum#+.akr2016-04-301-1/+3
| | | | | | | | | | * 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
* Define Integer#- instead of Bignum#-.akr2016-04-301-1/+3
| | | | | | | | | | * 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
* Define Integer#* instead of Bignum#*.akr2016-04-301-1/+3
| | | | | | | | | | * 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
* Define Integer#% instead of Bignum#%.akr2016-04-301-0/+1
| | | | | | | | | | * 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
* Define Integer#== instead of Bignum#==.akr2016-04-301-2/+18
| | | | | | | | | | * 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
* Define Integer#> instead of Bignum#>.akr2016-04-301-2/+16
| | | | | | | | | | | | | * 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
* Define Integer#>= instead of Bignum#>=.akr2016-04-301-2/+16
| | | | | | | | | | | | | * 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
* Define Integer#< instead of Bignum#<.akr2016-04-301-2/+16
| | | | | | | | | | | | | * 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
* Define Integer#<= instead of Bignum#<=.akr2016-04-301-2/+17
| | | | | | | | | | | | | * 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
* Define Integer#-@ instead of Fixnum#-@.akr2016-04-301-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54839 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Define Integer#remainder instead of Bignum#remainder.akr2016-04-301-0/+35
| | | | | | | | | | | | | * 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
* {Fixnum,Bignum}#-@ is unified into Integer.akr2016-04-301-4/+5
| | | | | | | | | | | * 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
* {Fixnum,Bignum}#div is unified into Integer.akr2016-04-301-4/+4
| | | | | | | | | | | * 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
* {Fixnum,Bignum}#modulo is unified into Integer.akr2016-04-301-2/+2
| | | | | | | | | | | * 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
* {Fixnum,Bignum}#divmod is unified into Integer.akr2016-04-301-4/+16
| | | | | | | | | | | * 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
* move Fixnum#/ document position.akr2016-04-301-9/+9
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* {Fixnum,Bignum}#fdiv is unified into Integer.akr2016-04-301-3/+18
| | | | | | | | | | | * 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
* {Fixnum,Bignum}#** is unified into Integer.akr2016-04-301-4/+22
| | | | | | | | | | | * 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
* Rename fix_rev and rb_big_neg to fix_comp and rb_big_comp.akr2016-04-301-3/+3
| | | | | | | | | | * 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
* {Fixnum,Bignum}#~ is unified into Integer.akr2016-04-301-3/+23
| | | | | | | | | | | | | * 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
* {Fixnum,Bignum}#& is unified into Integer.akr2016-04-301-3/+15
| | | | | | | | | | | * 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
* {Fixnum,Bignum}#| is unified into Integer.akr2016-04-301-3/+15
| | | | | | | | | | | * 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
* {Fixnum,Bignum}#^ is unified into Integer.akr2016-04-271-3/+15
| | | | | | | | | | | * 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
* [Doc] Add Document-method: directives.akr2016-04-271-0/+24
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Update rdoc of Integer#[] (fix -> int)kazu2016-04-271-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54797 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* [DOC] move rdoc comments.akr2016-04-271-137/+151
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* {Fixnum,Bignum}#[] is unified into Integer.akr2016-04-271-15/+33
| | | | | | | | | | | | | * 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
* [DOC] update Integer#<< doc.akr2016-04-261-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* {Fixnum,Bignum}#<< is unified into Integer.akr2016-04-261-8/+20
| | | | | | | | | | | | | * 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
* {Fixnum,Bignum}#>> is unified into Integer.akr2016-04-261-8/+20
| | | | | | | | | | | | | * 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
* {Fixnum,Bignum}#size is unified into Integer.akr2016-04-261-4/+19
| | | | | | | | | | | | * 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
* {Fixnum,Bignum}#bit_length is unified into Integer.akr2016-04-261-7/+32
| | | | | | | | | | | | | | | | | | | * 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
* * numeric.c (int_abs): Integer#{abs,magnitude} moved from Fixnum and Bignum.akr2016-04-261-13/+24
| | | | | | | | | | * 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
* numeric.c: numeric ndigitsnobu2016-04-181-12/+12
| | | | | | | * 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
* numeric.c: flo_truncatenobu2016-04-181-10/+27
| | | | | | | * 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
* numeric.c: int_truncatenobu2016-04-181-2/+63
| | | | | | | * 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
* numeric.c: update doc [ci skip]nobu2016-04-181-1/+1
| | | | | | | * numeric.c (int_to_i): [DOC] floor and ceil are no longer synonyms. [Feature #12245] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54621 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c: flo_ceilnobu2016-04-131-7/+39
| | | | | | | * numeric.c (flo_ceil): add an optional parameter, digits, as well as Float#round. [Feature #12245] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c: flo_floornobu2016-04-131-6/+40
| | | | | | | * numeric.c (flo_floor): add an optional parameter, digits, as well as Integer#floor. [Feature #12245] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c: int_ceilnobu2016-04-131-1/+57
| | | | | | | * numeric.c (int_ceil): add an optional parameter, digits, as well as Integer#round. [Feature #12245] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c: int_floornobu2016-04-131-1/+55
| | | | | | | * numeric.c (int_floor): add an optional parameter, digits, as well as Integer#round. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54561 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c: int_round_zero_pnobu2016-04-131-5/+21
| | | | | | | | | | * bignum.c (rb_big_size): add wrapper function of BIGSIZE and rename the method funtion with _m suffix. * numeric.c (int_round_zero_p): extracted from rb_int_round. optimize for Bignum, and convert VALUE returned by Numeric#size to long. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e