On Wed, Apr 11, 2012 at 7:17 PM, Nobuyoshi Nakada <nobu / ruby-lang.org> wrot=
e:
> Hi,
>
> (12/04/12 0:17), Thomas E Enebo wrote:
>> b =3D BigDecimal("1") / 1.0
>> p b, b.class
>>
>> I was surprised to see b.class print out as a Float. =A0Can someone
>> explain why this is?
>
> While BigDecimal has precision info, but Float doesn't. =A0So `b' also
> doesn't have. =A0Therefore it can't be BigDecimal.
>
> Does this make sense?

yeah I wondered if it was mixing known precision with unknown.  I
guess it just looked weird because if the Bigdecimal had more
precision than a float it could contain it would lose something.  With
that said it is being divided by an inprecise type...

Thanks for the explanation,
-Tom
>
> --
> Nobu Nakada
>



--=20
blog: http://blog.enebo.com=A0 =A0 =A0=A0 twitter: tom_enebo
mail: tom.enebo / gmail.com