From: naruse@... Date: 2017-03-11T13:03:50+00:00 Subject: [ruby-core:80017] [Ruby trunk Bug#13078] with Integer a and b, a.fdiv(b) sometimes inaccurate than Rational(a, b).to_f Issue #13078 has been updated by Yui NARUSE. Backport changed from 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN to 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: DONE ruby_2_4 r57840 merged revision(s) 57227. ---------------------------------------- Bug #13078: with Integer a and b, a.fdiv(b) sometimes inaccurate than Rational(a, b).to_f https://bugs.ruby-lang.org/issues/13078#change-63436 * Author: Makoto Kishimoto * Status: Closed * Priority: Normal * Assignee: * Target version: * ruby -v: * Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: DONE ---------------------------------------- For example, ~~~ a = 3 b = 0x20_0000_0000_0001 p a.fdiv(b) p Rational(a, b).to_f #=> 3.3306690738754696e-16 3.330669073875469e-16 ~~~ I'm hacking to solve this problem, see diff view. https://github.com/ruby/ruby/compare/trunk...metanest:fdiv_spike -- https://bugs.ruby-lang.org/ Unsubscribe: