return float when dividing two integers?

Hi,

sorry for stupid newbie question, but can't google it out:

i'd like 'integer1 / integer2' to return float instead of integer, i.e. in case integer1=5 and integer2=2 the result is 2.5 not 2.

the only way i found so far is 'result = 1.0*integer1/integer2' which i feel is somewhat clumsy

thank you very much

pepa007 wrote:

Hi,

sorry for stupid newbie question, but can't google it out:

i'd like 'integer1 / integer2' to return float instead of integer, i.e. in case integer1=5 and integer2=2 the result is 2.5 not 2.

the only way i found so far is 'result = 1.0*integer1/integer2' which i feel is somewhat clumsy

thank you very much

integer1.to_f/integer2 ?