[#78633] ruby/spec needs help from CRuby committers — Benoit Daloze <eregontp@...>
Currently, ruby/spec is maintained mostly by individuals and enjoys the
13 messages
2016/12/13
[#78963] Re: ruby/spec needs help from CRuby committers
— Urabe Shyouhei <shyouhei@...>
2017/01/04
I did ask attendees of last developer meeting to join this
[#78642] Re: ruby/spec needs help from CRuby committers
— Eric Wong <normalperson@...>
2016/12/14
Benoit Daloze <eregontp@gmail.com> wrote:
[ruby-core:78885] [Ruby trunk Bug#13078] with Integer a and b, a.fdiv(b) sometimes inaccurate than Rational(a, b).to_f
From:
s.wanabe@...
Date:
2016-12-28 03:00:10 UTC
List:
ruby-core #78885
Issue #13078 has been updated by _ wanabe. The accuracy of `Rational(a, b).to_f` seems to be due to reduction of fraction. How about using Reational object, or its internal function `f_gcd()` and `f_idiv()`? ---------------------------------------- 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-62296 * Author: Makoto Kishimoto * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: * Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN ---------------------------------------- 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: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>