From: Ranieri Teixeira Date: 2008-02-08T08:15:03+09:00 Subject: Re: BigDecimal.new('15.25') == 15.25, false ?? ------=_Part_41802_2698280.1202426097270 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi, Henry I'm writing a Ruby app that need very precise float point arithmetic. So, I'm using BigDecimal and test my code with unit tests, at windows xp with Ruby 1.8.6, also. This seems a problem with float point number representation and comparison. I wrote the following method, to test what you want to: def *test_big_decimal* *assert_in_delta* 15.25, *BigDecimal*('15.25'), 0.001 end And... it pass. I've found this type here, at ruby-talk. Do a search for a message with "assert_equal problem" to see the reply. Now, all my code in unit tests uses assert_in_delta, instead assert_equal o= r raw comparisons with assert and "=3D=3D". I hope it help. --=20 Ranieri Barros Teixeira Ci=EAncia da Computa=E7=E3o - Faculdade de Computa=E7=E3o - Universidade F= ederal do Par=E1 (UFPA) http://rubyxchart.rubyforge.org http://rubytags.blogspot.com ------=_Part_41802_2698280.1202426097270--