Greg Hauptmann
11/8/2008 8:23:00 PM
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 <pyeniemi@gmail.com> wrote:
> On Nov 8, 8:26 am, Greg Hauptmann <greg.hauptmann.r...@gmail.com>
> 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
>
>