From: Thomas E Enebo Date: 2012-04-13T23:02:14+09:00 Subject: [ruby-core:44339] Re: Bigdecimal / 1.0 => Float? On Wed, Apr 11, 2012 at 7:17 PM, Nobuyoshi Nakada wrote: > Hi, > > (12/04/12 0:17), Thomas E Enebo wrote: >> b = BigDecimal("1") / 1.0 >> p b, b.class >> >> I was surprised to see b.class print out as a Float. �Can someone >> explain why this is? > > While BigDecimal has precision info, but Float doesn't. �So `b' also > doesn't have. �Therefore 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 > -- blog: http://blog.enebo.com� � �� twitter: tom_enebo mail: tom.enebo@gmail.com