Open
Description
x = BigDecimal('1.'+'1'*1000)
x.precision #=> 1001
x.sqrt(200).precision #=> expected: 200+extra, actual: 1126
Actual problem
x=BigDecimal('3.14')
100.times{
x = x.sqrt(200)
p x.precision
}
# Expect output
208
213
209
210
208
209
...(completes in about 0.03s)
# Actual output
208
226
253
289
...
9504
10567
11736
...(does not end)
Workaround
x.sqrt(prec).mult(1, prec)
Metadata
Metadata
Assignees
Labels
No labels