summaryrefslogtreecommitdiff
path: root/numeric.rb
AgeCommit message (Collapse)Author
2024-02-17Use `defined?(yield)` and `SIZED_ENUMERATOR`Nobuyoshi Nakada
Prefer built-in features over method calls that may be overridden.
2024-01-23YJIT: Allow inlining ISEQ calls with a block (#9622)Takashi Kokubun
* YJIT: Allow inlining ISEQ calls with a block * Leave a TODO comment about u16 inline_block
2023-09-07Rewrite Integer#times in Ruby (#8388)Takashi Kokubun
Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2023-08-13[DOC] RDoc for numeric.rb (#8216)Burdette Lamar
Notes: Merged-By: peterzhu2118 <peter@peterzhu.ca>
2023-04-10[DOC] The Document-method hint is needed only in C filesŠimon Lukašík
'Document-method' string in C file has a special treatment. In Ruby source file, however, it is considered to be part of the documentation. Note Numeric#size was migrated from C to Ruby, in 3208a5df2dfb429752a130a36274464e9924cf44 Notes: Merged: https://github.com/ruby/ruby/pull/7682 Merged-By: nobu <nobu@ruby-lang.org>
2023-03-11Rename builtin attr :inline to :leafTakashi Kokubun
2023-03-10Change the syntax of Primitive.attr! to Symbol (#7501)Takashi Kokubun
Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2023-02-19Remove (newly unneeded) remarks about aliasesBurdetteLamar
2023-01-30Avoid using a weird syntax for documentationTakashi Kokubun
Following up 465bd972ec2. If the actual implementation still resides in C, it should be documented in C just like all other places.
2023-01-30Avoid leaving an uneeded commentTakashi Kokubun
465bd972ec2 didn't need to leave the obsoleted code.
2023-01-22Fix Integer#ceildiv to respect #coerce (#7118)Kouhei Yanagita
Fixes [Bug #19343] Notes: Merged-By: mrkn <mrkn@ruby-lang.org>
2022-10-27Improve performance some `Integer` and `Float` methods [Feature #19085] (#6638)S.H
* Improve some Integer and Float methods * Using alias and Remove unnecessary code * Remove commentout code Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2022-08-12Improve performance of Integer#ceildivKouhei Yanagita
This patch is suggested by nobu. Benchmark result: ``` require 'benchmark' n = 10 ** 7 Benchmark.bm do |x| x.report("Fixnum/Fixnum") { a, b = 5, 2; n.times { a.ceildiv(b) } } x.report("Bignum/Bignum") { a, b = 10**100, 10**99 - 1; n.times { a.ceildiv(b) } } x.report("Bignum/Fixnum") { a, b = 10**100, 3; n.times { a.ceildiv(b) } } end ``` Original: ``` user system total real Fixnum/Fixnum 3.340009 0.043029 3.383038 ( 3.384022) Bignum/Bignum 8.229500 0.118543 8.348043 ( 8.349574) Bignum/Fixnum 8.328971 0.097842 8.426813 ( 8.426952) ``` Improved: ``` user system total real Fixnum/Fixnum 0.699140 0.000961 0.700101 ( 0.700199) Bignum/Bignum 5.076165 0.083160 5.159325 ( 5.159360) Bignum/Fixnum 5.548684 0.115372 5.664056 ( 5.666735) ``` Notes: Merged: https://github.com/ruby/ruby/pull/5965
2021-12-15Add examples for Integer.try_convert [ci skip]Matheus Richard
Notes: Merged: https://github.com/ruby/ruby/pull/5268 Merged-By: nobu <nobu@ruby-lang.org>
2021-12-15Fix typo on Integer.try_convert [ci skip]Matheus Richard
2021-12-08[DOC] Integer.try_convert [ci skip]Nobuyoshi Nakada
2021-11-15Enhanced RDoc for Integer (#5118)Burdette Lamar
Treats: #allbits? #anybits? #nobits? #succ #pred #chr` #to_s #+ #- Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2021-09-05Replace RBOOL macroS-H-GAMELINKS
Notes: Merged: https://github.com/ruby/ruby/pull/4791
2021-08-30[DOC] Move rdoc of Integer#abs to numeric.rb [ci skip]Nobuyoshi Nakada
2021-06-04Improve perfomance for Integer#size method [Feature #17135] (#3476)S.H
* Improve perfomance for Integer#size method [Feature #17135] * re-run ci * Let MJIT frame skip work for Integer#size Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com> Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2021-03-04Strip trailing spaces [ci skip]Nobuyoshi Nakada
2021-02-19Improve performance some Numeric methods [Feature #17632] (#4190)S.H
Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2021-02-08Improve performance Float#positive? and Float#negative? [Feature #17614] (#4160)S.H
Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2021-01-18Fix JIT link failuresTakashi Kokubun
forgotten in https://github.com/ruby/ruby/pull/4018
2021-01-01Improve performance some Float methods [Feature #17498] (#4018)S.H
Notes: Merged-By: k0kubun <takashikkbn@gmail.com>