22 May
2026
22 May
'26
3:05 p.m.
Issue #22079 has been reported by cryptogopher (crypto gopher). ---------------------------------------- Bug #22079: Float#ceil gives incorrect result https://bugs.ruby-lang.org/issues/22079 * Author: cryptogopher (crypto gopher) * Status: Open * ruby -v: ruby 3.3.7 (2025-01-15 revision be31f993d7) [x86_64-linux] * Backport: 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN ---------------------------------------- Let's take following number as an example: ``` ruby
Float::MIN => 2.2250738585072014e-308
This gives proper result:
```ruby
> Float::MIN.ceil(308)
=> 2.9999999999999997e-308
But this does not: ```ruby
Float::MIN.floor(309) => NaN
even though the result is perfectly valid `Float` number:
```ruby
> "2.3e-308".to_f
=> 2.3e-308