From: Neil Stevens Date: 2005-04-15T07:24:49+09:00 Subject: Re: when 1.6 != 1.6? -- newbie On Fri, 15 Apr 2005 08:11:27 +0900, Ilmari Heikkinen wrote: > Either do fixed-point decimals with integers and decimal point > divisor (100 => 1.00*100; 100 + 20 + 20 + 20 - 160 => 0) > or pick an error threshold and check that (a - b) < threshold > (1.0 + 0.2 + 0.2 + 0.2 - 1.6) < 0.01 > => true Just use BigDecimal. No need to get tricky. -- Neil Stevens - neil@hakubi.us 'A republic, if you can keep it.' -- Benjamin Franklin