summaryrefslogtreecommitdiff
path: root/numeric.rb
Commit message (Collapse)AuthorAgeFilesLines
* [DOC] The Document-method hint is needed only in C filesŠimon Lukašík2023-04-101-2/+0
| | | | | | '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
* Rename builtin attr :inline to :leafTakashi Kokubun2023-03-111-14/+14
|
* Change the syntax of Primitive.attr! to Symbol (#7501)Takashi Kokubun2023-03-101-14/+14
|
* Remove (newly unneeded) remarks about aliasesBurdetteLamar2023-02-191-5/+0
|
* Avoid using a weird syntax for documentationTakashi Kokubun2023-01-301-22/+0
| | | | | | | Following up 465bd972ec2. If the actual implementation still resides in C, it should be documented in C just like all other places.
* Avoid leaving an uneeded commentTakashi Kokubun2023-01-301-6/+0
| | | | 465bd972ec2 didn't need to leave the obsoleted code.
* Fix Integer#ceildiv to respect #coerce (#7118)Kouhei Yanagita2023-01-221-1/+1
| | | Fixes [Bug #19343]
* Improve performance some `Integer` and `Float` methods [Feature #19085] (#6638)S.H2022-10-271-9/+65
| | | | | | | * Improve some Integer and Float methods * Using alias and Remove unnecessary code * Remove commentout code
* Improve performance of Integer#ceildivKouhei Yanagita2022-08-121-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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) ```
* Add examples for Integer.try_convert [ci skip]Matheus Richard2021-12-151-0/+3
|
* Fix typo on Integer.try_convert [ci skip]Matheus Richard2021-12-151-1/+1
|
* [DOC] Integer.try_convert [ci skip]Nobuyoshi Nakada2021-12-081-0/+19
|
* Enhanced RDoc for Integer (#5118)Burdette Lamar2021-11-151-0/+1
| | | | | | | | | | | | | | Treats: #allbits? #anybits? #nobits? #succ #pred #chr` #to_s #+ #-
* Replace RBOOL macroS-H-GAMELINKS2021-09-051-3/+3
|
* [DOC] Move rdoc of Integer#abs to numeric.rb [ci skip]Nobuyoshi Nakada2021-08-301-0/+14
|
* Improve perfomance for Integer#size method [Feature #17135] (#3476)S.H2021-06-041-0/+20
| | | | | | | | | * 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>
* Strip trailing spaces [ci skip]Nobuyoshi Nakada2021-03-041-2/+2
|
* Improve performance some Numeric methods [Feature #17632] (#4190)S.H2021-02-191-0/+46
|
* Improve performance Float#positive? and Float#negative? [Feature #17614] (#4160)S.H2021-02-081-0/+22
|
* Fix JIT link failuresTakashi Kokubun2021-01-181-1/+1
| | | | forgotten in https://github.com/ruby/ruby/pull/4018
* Improve performance some Float methods [Feature #17498] (#4018)S.H2021-01-011-0/+207