Actions
Bug #20873
closed`printf("%f")` returns wrong result for `Rational` with `FIXNUM_MIN`
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
Updated by nobu (Nobuyoshi Nakada) 18 days ago
- 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
Updated by nobu (Nobuyoshi Nakada) 17 days ago
- Status changed from Open to Closed
Applied in changeset git|d71be7274bd2623bb521be72c245c08fc38d6ae4.
[Bug #20873] Consider -FIXNUM_MIN
overflow
-FIXNUM_MIN
is usually greater than FIXNUM_MAX
on platforms using
two's complement representation.
Updated by nagachika (Tomoyuki Chikanaga) 13 days ago
- Backport changed from 3.1: REQUIRED, 3.2: REQUIRED, 3.3: REQUIRED to 3.1: REQUIRED, 3.2: DONE, 3.3: REQUIRED
ruby_3_2 a7b013b392ca0ba4930e579f4c9e40d99d871752 merged revision(s) d71be7274bd2623bb521be72c245c08fc38d6ae4.
Actions
Like0
Like0Like0Like0