From: Rick DeNatale Date: 2008-09-14T23:08:01+09:00 Subject: Re: how do deal with huge numbers and keep them accurate? ------=_Part_88626_22027383.1221401701319 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On Sun, Sep 14, 2008 at 8:18 AM, Tomi Zzzz wrote: > Hello all, I wrote the following code: > > require "bigdecimal" > require "bigdecimal/math" > include BigMath > odd = gets.chomp.to_f This gives you a float, NOT a bigdecimal. > > result = odd/3.0 > puts result.to_f Try odd = BigDecimal.new(gets.chomp) puts odd/3 # or odd/3.0 -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/ ------=_Part_88626_22027383.1221401701319--