https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112011-12-02T09:17:41ZRuby Issue Tracking SystemRuby master - Bug #5699: Windowsで一部のFloat値が正しく扱えないhttps://bugs.ruby-lang.org/issues/5699?journal_id=225462011-12-02T09:17:41Zujihisa (Tatsuhiro Ujihisa)
<ul></ul><p>浮動小数点数の計算には誤差があります。参考サイト:</p>
<ul>
<li><a href="http://download.oracle.com/docs/cd/E19957-01/806-4847/ncg_goldberg.html" class="external">http://download.oracle.com/docs/cd/E19957-01/806-4847/ncg_goldberg.html</a></li>
<li><a href="http://wiki.github.com/rdp/ruby_tutorials_core/ruby-talk-faq#floats_imprecise" class="external">http://wiki.github.com/rdp/ruby_tutorials_core/ruby-talk-faq#floats_imprecise</a></li>
<li><a href="http://en.wikipedia.org/wiki/Floating_point#Accuracy_problems" class="external">http://en.wikipedia.org/wiki/Floating_point#Accuracy_problems</a></li>
</ul> Ruby master - Bug #5699: Windowsで一部のFloat値が正しく扱えないhttps://bugs.ruby-lang.org/issues/5699?journal_id=225472011-12-02T10:02:23Zoku (剛 奥山)oku1111@gmail.com
<ul></ul><p>FAQでした、すみません。</p>
<p>1.9.2 は、より正しく表示出来るようになったということで<br>
納得しました。</p>
<p><a href="https://github.com/rdp/ruby_tutorials_core/wiki/ruby-talk-faq#floats_imprecise" class="external">https://github.com/rdp/ruby_tutorials_core/wiki/ruby-talk-faq#floats_imprecise</a></p>
<blockquote>
<blockquote>
<p>1.1<br>
=> 1.1 # in reality this probably doesn't equal exactly 1.1 deep down--but it's equal to 1.1's default so ruby 1.9.2 will display it as 1.1<br>
0.9<br>
=> 0.9<br>
1.1-0.9<br>
=> 0.20000000000000007 # now ruby 1.9.2 notices that "this 0.2 is not the same as the default float for 0.2" so it displays its full version to remind us of this fact.</p>
</blockquote>
</blockquote> Ruby master - Bug #5699: Windowsで一部のFloat値が正しく扱えないhttps://bugs.ruby-lang.org/issues/5699?journal_id=225502011-12-02T10:20:15Zujihisa (Tatsuhiro Ujihisa)
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Rejected</i></li></ul>