Re: [gcj] Re: Numbers problem.

2012-04-09 Thread Luke Pebody
For the hardest problem of the large data set, you are looking at getting the integer part of (3+sqrt(5))^(2,000,000,000). The number of decimal places you need to make that calculation accurately is more than 1,000,000,000: (3+sqrt(5)+x)^2,000,000,000 >= (3+sqrt(5))^2,000,000,000+2,000,000,000

Re: [gcj] Re: Numbers problem.

2012-04-08 Thread Abizern
IIRC if the answers match to six decimal places, they are considered equal. On 8 April 2012 19:44, Sachin Gupta wrote: > BigDecimal in java can store it. The statement > System.out.println(x.toString()); shows the value with 48 decimal places, > do we need more than that. > > > On Sunday, Apri

[gcj] Re: Numbers problem.

2012-04-08 Thread Sachin Gupta
BigDecimal in java can store it. The statement System.out.println(x.toString()); shows the value with 48 decimal places, do we need more than that. On Sunday, April 8, 2012, Luke Pebody wrote: > The numeric types used by programming languages are not accurate enough to > keep the full decimal e

[gcj] Re: Numbers problem.

2012-04-08 Thread Sachin Gupta
I haven't tried milkshake yet. i'll try binomial theorem but can you please tell why my code is not working On Sunday, April 8, 2012, Samuel Jawahar wrote: > use the Binomial theorem to solve this. > did you solve the milkshake problem? > > On Sun, Apr 8, 2012 at 6:28 PM, Sachin Gupta > 'sachi