Robert Klemme wrote in post #1119418:
> On Thu, Aug 22, 2013 at 10:55 PM, Fldes Lszl
> <lists / ruby-forum.com>wrote:
>
>> => "1.1452"
>>
> 
998229840756361333048675137604431608257538375836478005205851705333523733848357300705094580513261348742578974976"
>>
>> Using #round solves the problem, but there is clearly a problem. Any
>> idea how to properly parameter the method so I don't need to use #round?
>> Checking the C source (I'm not a C ninja) it looks that a FLOAT value
>> gets converted if it equals with its rounded self which is certainly
>> true (although I don't know the precision) if the value is X.0
>
>
> I would not worry about the number of digits in the BigDecimal instance.
>  Internally you should use most precise figures. If you want to do
> output
> then you can apply proper formatting, e.g. with printf.
>
> Cheers
>
> robert

My problem is that if calculation continues with so many digits, it will 
be horribly slow. If I repeat the #power method with the long result, 
after ten iteration it yields 5.000 digits, I assume a few ten thousand 
iteration will result in an OutOfMemory error.

-- 
Posted via http://www.ruby-forum.com/.