no i didn't realize that. i thought ruby would automatically change it to a 
float if need be, i.e. with divison, just as it changes to Bignum if need be.

honestly i don't like it. now i have to go around adding .0's all over the 
place to make sure the math comes out right. and in some places i have to do 
things like multiple by 1.0 b/c certain values come from cgi script variables 
i have no control over.

well, it will suffice now that i know, but to me it is definitely not POLS.

-tom



On Thursday 26 December 2002 11:19 pm, Gavin Sinclair wrote:
> Hello Tom,
>
> On Friday, December 27, 2002, 4:59:59 PM, you wrote:
> > can someone explain this to me:
> >
> >         puts "#{1210 / 100}" --> 12
> >
> > why isn't the answer 12.1?
> >
> > i was getting ticked at javascript for producing poor arithmetic results
> > but this is nuts!
> >
> > -transami
>
> I'm surprised you don't know this, Tom.  In Ruby, and several other
> languages, the division of two integers results in an integer.  To get
> a floating-point answer, use
>
>   puts "#{1210.0 / 100}      --> 12.1
>
> (You could use 100.0 as well/instead.)
>
> Cheers,
> Gavin [who just added this to the FAQ]