From: Greg Hauptmann Date: 2008-11-09T05:22:58+09:00 Subject: Re: what's easiest way to compare a Float & BigDecimal (i.e. like a equals mechanism) oh so convert the BigDecimal to a float by multiplying by 1.0 you mean first? On Sun, Nov 9, 2008 at 6:12 AM, pen wrote: > On Nov 8, 8:26 am, Greg Hauptmann > wrote: >> Hi, >> >> what's easiest way to compare a Float & BigDecimal (i.e. like a equals >> mechanism)? It seems that "==" does NOT work as they are different >> types. Is there a way to do a comparison without having to convert >> types? > > Actually, there is none. Why don't you just let Ruby do the job and > multiply the bigdecimal with 1.0 when comparing? Also, as previously > noted, == operator with floats is not ... reliable. > > br, > > pen > >