General

Profile

sferik (Erik Berlin)

  • Login: sferik
  • Email: sferik@gmail.com
  • Registered on: 02/28/2011
  • Last sign in: 11/18/2026

Issues

open closed Total
Assigned issues 0 0 0
Reported issues 7 6 13

Activity

11/19/2026

08:49 PM Ruby Feature #21308: Replacing the Float#to_s (dtoa.c) implementation with a modern algorithm
akr (Akira Tanaka) wrote in #note-8:
> I'm afraid the new implementation's behavior is different from Ruby's.
> ...
It does. Schubfach finds the shortest digits that read back as the same Float, which is what mode 0 of `dtoa` does, so ...
sferik (Erik Berlin)
06:52 PM Ruby Bug #22610: Array#eql?, #- and #& ignore a redefined #eql? of Integer, Float, Symbol, nil, true and false
I've opened a pull request with a fix: https://github.com/ruby/ruby/pull/20026
It adds a `BOP_EQL` basic operator for the classes that the fast path handles and checks it instead of `BOP_EQ` when the fast path is answering for `#eql?`...
sferik (Erik Berlin)
06:51 PM Ruby Bug #22610 (Open): Array#eql?, #- and #& ignore a redefined #eql? of Integer, Float, Symbol, nil, true and false
On master, methods that compare elements with `eql?` in C, such as `Array#eql?`, `Array#-` and `Array#&`, don't call a redefined `#eql?` when the receiver is an Integer, a Float, a Symbol, `nil`, `true`, `false` or a String:
```ruby
...
sferik (Erik Berlin)
06:17 PM Ruby Bug #22609: String#to_f misrounds numbers close to halfway between two Floats on 32-bit x86 with x87
I've opened a pull request with a fix: https://github.com/ruby/ruby/pull/20024
It sets the x87 rounding precision to 53 bits while `strtod` from missing/dtoa.c runs, and restores it afterward. It was split out of https://github.com/ru...
sferik (Erik Berlin)
06:16 PM Ruby Bug #22609 (Open): String#to_f misrounds numbers close to halfway between two Floats on 32-bit x86 with x87
On 32-bit x86 builds that use the x87 FPU for floating point, `String#to_f` sometimes returns the wrong one of two neighboring Floats when the number is very close to halfway between them. The same goes for `Float()` and `Marshal.load`, ... sferik (Erik Berlin)
04:27 PM Ruby Bug #22608: Enumerable#sort_by ignores Integer#<=> or Float#<=> redefined in the block
I've opened a pull request with a fix: https://github.com/ruby/ruby/pull/20023
It checks the redefinition again after the block has been called for every element. It was split out of https://github.com/ruby/ruby/pull/19306 as discusse...
sferik (Erik Berlin)
04:26 PM Ruby Bug #22608 (Open): Enumerable#sort_by ignores Integer#<=> or Float#<=> redefined in the block
`Enumerable#sort_by` ignores a redefinition of `Integer#<=>` or `Float#<=>` that happens while the block is running, when every key is an Integer or every key is a Float.
```ruby
redefined = false
[3, 1, 2, 5, 4].sort_by do |x|
u...
sferik (Erik Berlin)
04:27 PM Ruby Bug #22607: Rational#to_f and Integer#fdiv are not correctly rounded for large operands
I've opened a pull request with a fix: https://github.com/ruby/ruby/pull/20022
It divides the Integers to a quotient a few bits wider than a double and rounds once. It was split out of https://github.com/ruby/ruby/pull/19309 as discus...
sferik (Erik Berlin)
04:25 PM Ruby Bug #22607 (Open): Rational#to_f and Integer#fdiv are not correctly rounded for large operands
`Rational#to_f`, and `Integer#fdiv` with an Integer argument, don't always return the Float nearest to the quotient when the numerator or the denominator is too large to be exact as a double.
```ruby
r = Rational(74251560964839315833...
sferik (Erik Berlin)

11/09/2026

07:12 AM Ruby Revision 39c3c361 (git): [ruby/json] Java generator: call as_json only once for invalid
strings
(https://github.com/ruby/json/pull/1127)
When a string with invalid encoding is generated in strict mode, the
Java and pure-Ruby generators call as_json on it. If as_json returned
a Symbol, the Symbol was turned back into the sa...
sferik (Erik Berlin)

Also available in: Atom