| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
| |
Extracted arguments do not have keyword hash to splat.
|
|
|
|
|
|
|
| |
Following up 465bd972ec2.
If the actual implementation still resides in C, it should be
documented in C just like all other places.
|
|
|
| |
Also `Numeric#remainder` should.
|
|
|
|
| |
Handle the integert and the float parts separately in round_half_even
to prevent error occursions in floating point calculation.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
```
|
| |
|
| |
|
|
|
|
| |
[Misc #18891]
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
Method references is not only able to be marked up as code, also
reflects `--show-hash` option.
The bug that prevented the old rdoc from correctly parsing these
methods was fixed last month.
|
|
|
|
|
|
|
| |
* Fix formatting for What's Here in IO
* Repair formatting in What's Heres in numeric.c
* Fix formatting for What's Here in IO
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current example raises the following error.
```ruby
0..chr # => undefined local variable or method `chr' for main:Object (NameError)
```
This PR updates the example to produce the expected behavior.
```ruby
0.chr # => "\x00"
```
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
I used this regex:
(?<=\[)#(?:class|module)-([A-Za-z]+)-label-([A-Za-z0-9\-\+]+)
And performed a global find & replace for this:
rdoc-ref:$1@$2
|
|
|
|
|
|
|
|
|
|
| |
I used this regex:
([A-Za-z]+)\.html#(?:class|module)-[A-Za-z]+-label-([A-Za-z0-9\-\+]+)
And performed a global find & replace for this:
rdoc-ref:$1@$2
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
* Adding links to literals and Kernel
|
|
|
|
|
|
|
| |
The methods aren't called for FIXNUM, and it's best to have
consistent behavior.
Fixes [Bug #18377]
|
|
|
| |
Adds remarks about literals and Kernel methods to Float and Integer.
|
| |
|
|
|
| |
* What's Here for Float
|
|
|
|
|
|
|
| |
* Enhanced RDoc for Float#floor
* Enhanced RDoc for Float
* Enhanced RDoc for Float
|
|
|
| |
* Enhanced RDoc for Float#prev_float
|
|
|
|
| |
* Enhanced RDoc for Float#next_float
|
|
|
| |
* What's Here section for Integer
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Treats:
#>
#>=
#<
#<=
#eql?
#nan?
#infinite?
#finite?
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Treated (or previously treated):
#quo
#%
#divmod
#**`
#eql?
#<=>
#==
#hash
|
|
|
|
|
|
|
|
|
|
|
| |
Treats:
#to_s
#coerce
#+
#-
#*
#/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This provides a significant speedup for symbol, true, false,
nil, and 0-9, class/module, and a small speedup in most other cases.
Speedups (using included benchmarks):
:symbol :: 60%
0-9 :: 50%
Class/Module :: 50%
nil/true/false :: 20%
integer :: 10%
[] :: 10%
"" :: 3%
One reason this approach is faster is it reduces the number of
VM instructions for each interpolated value.
Initial idea, approach, and benchmarks from Eric Wong. I applied
the same approach against the master branch, updating it to handle
the significant internal changes since this was first proposed 4
years ago (such as CALL_INFO/CALL_CACHE -> CALL_DATA). I also
expanded it to optimize true/false/nil/0-9/class/module, and added
handling of missing methods, refined methods, and RUBY_DEBUG.
This renames the tostring insn to anytostring, and adds an
objtostring insn that implements the optimization. This requires
making a few functions non-static, and adding some non-static
functions.
This disables 4 YJIT tests. Those tests should be reenabled after
YJIT optimizes the new objtostring insn.
Implements [Feature #13715]
Co-authored-by: Eric Wong <e@80x24.org>
Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
Co-authored-by: Yusuke Endoh <mame@ruby-lang.org>
Co-authored-by: Koichi Sasada <ko1@atdot.net>
|
|
|
|
|
|
|
|
| |
Treats:
#<<
#>>
#to_s
|
|
|
|
|
|
|
|
|
|
|
| |
Treats:
#times
#round
#floor
#ceil
#truncate
::sqrt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Treated:
#==
#<=>
#<
#<=
#>
#>=
#&
#|
#^
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Treated:
#+
#-
#*
#fdiv
#/
#div
#**
#[]
#digits
#upto
#downto
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Treats:
#allbits?
#anybits?
#nobits?
#succ
#pred
#chr`
#to_s
#+
#-
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit fc456adc6a62d09b755243b8c8f190934b9965d6.
It broke the CI check.
https://github.com/ruby/ruby/runs/4207922247?check_suite_focus=true#step:3:4
```
numeric.c:3518: * 255.chr(Encoding::UTF_8) # => "ΓΏ"
Error: Process completed with exit code 1.
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Treats:
#allbits?
#anybits?
#nobits?
#succ
#pred
#chr`
#to_s
#+
#-
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Treats:
#eql?
#<+>
#floor
#ceil
#round
#truncate
#step
|
| |
|