From: Florian Frank Date: 2005-04-15T07:08:53+09:00 Subject: Re: when 1.6 != 1.6? -- newbie Mel Bohince wrote: > Any clues to what I'm doing wrong? When you're using assert_equal, you're comparing two floating point numbers with ==. That's usually a bad idea, because rounding errors can/will occur. Try using assert_in_delta(number1, number2, delta), to find out, if |number1 - number2| <= delta instead. Another tip: If you want to represent prices in your programs, don't use floats at all. Use integers for the representation of the cent values and all computations, and divide by 100 only for the string representation of the numbers. -- Florian Frank