may be you can break the calculations. i mean

for example 2^40 can be written as 2^10 * 2^10 * 2^10 * 2^10
may be this works out

regards,
junaid

On Sun, Apr 17, 2011 at 1:54 PM, Shrikant Sonone
<[email protected]>wrote:

> Problem:
>
> http://code.google.com/codejam/contest/dashboard?c=32016#s=p2
>
> we have to solve this equation (3 + √5)*n *and print its last three digits
> before decimal point
>
> My Code runs smooth for Small data sheet where 2<=n<=30
> but, it gives infinite values on the large data sheet where
> 2<=n<=2000000000
>
> I used long double data type to solve this using pow(x,y) but the is still
> too high for (3 + √5)2000000000
>
> Is there any other method to solve this ?????
>
>  --
> You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/google-code?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.

Reply via email to