Bug #20873
closed
`printf("%f")` returns wrong result for `Rational` with `FIXNUM_MIN`
Added by nobu (Nobuyoshi Nakada) 5 months ago.
Updated 3 months ago.
Description
Since the beginning, ruby 2.3.
require 'rbconfig/sizeof'
fmin, fmax = RbConfig::LIMITS.values_at("FIXNUM_MIN", "FIXNUM_MAX")
sprintf("%f", Rational(fmin, fmax)) #=> --1.000000
- Assignee set to nobu (Nobuyoshi Nakada)
- Backport changed from 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN to 3.1: REQUIRED, 3.2: REQUIRED, 3.3: REQUIRED
- Status changed from Open to Closed
- Backport changed from 3.1: REQUIRED, 3.2: REQUIRED, 3.3: REQUIRED to 3.1: REQUIRED, 3.2: DONE, 3.3: REQUIRED
- Backport changed from 3.1: REQUIRED, 3.2: DONE, 3.3: REQUIRED to 3.1: REQUIRED, 3.2: DONE, 3.3: DONE
Also available in: Atom
PDF
Like0
Like0Like0Like0Like0