From: Vikas Sarin Date: 2009-07-17T14:29:41+09:00 Subject: Re: I have some Ruby math questions that need answering 99.0/100 or 99/100.0 will also work! You would have to keep one floating point to get a floating point result! regards, Vikas Sarin Senior Software Quality Engineer QA Infotech Email: vikassarin@qainfotech.net Mob#: +919810319641 -----Original Message----- From: Ralf Mueller [mailto:ralf.mueller@zmaw.de] Sent: Friday, July 17, 2009 10:51 AM To: ruby-talk ML Subject: Re: I have some Ruby math questions that need answering Älphä Blüë wrote: > When handling percentage calculations: > > Simple 99/100.. > > Will I always have to do 99.to_f/100.to_f in order to receive 0.99? Or > is there a simpler way of performing this task in ruby.. > > or you use require 'mathn' and I bet, there is much stuff in the facets-pakage: http://facets.rubyforge.org/