6. Floatは不正確! (1/2)
● 超FAQ
x = 0.0
10.times { x += 0.1 }
x == 1.0 #=> false!?
● 何度「バグ報告」されてるか分からない
● 例えば
http://redmine.ruby-lang.org/issues/show/4394
● “Learn floating point numbers. What Every
Computer Scientist Should Know About Floating-
Point Arithmetic ...” by @nalsh
decimal.rubyforge.org