actually, i want to calculate 2^60000 in 1 second. i have tried a way but it is giving output in specified time for 1000 power only.(i have used arrays to store a one integer).
will you please give me a hint only how to do that ?
"I AM NOT ASKING FOR THE CODE TO YOU, JUST A ALGORITHM OR A START UP TO DO THAT"
gourav1 -12 Posting Whiz in Training
Recommended Answers
Jump to PostFirst off, I'm not sure, OK?
For smaller numbers, I'd suggest looking into bit shifting, and how each shift leftward, multiplies by 2. Bit shifting is among the fastest operations on a computer, in C.
00000001 = 1
00000010 = 2
00000100 = 4
etc.But your …
Jump to PostWell, I wasn't sure when I first read your initial post, but now, I'm pretty sure. See if this example doesn't stir up some zing for you:
I want to find 2^2. (It is frequently best to tackle a big thing, by first studying a smaller example of it).
…
Jump to PostTake a look at http://www.daniweb.com/software-development/c/threads/417121/calculating-powers-of-2, I got his program to calculate 2^50000 in 1.5 seconds.
All 9 Replies
asrockw7 18 Junior Poster in Training
Adak 419 Nearly a Posting Virtuoso
gourav1 -12 Posting Whiz in Training
Adak 419 Nearly a Posting Virtuoso
gourav1 -12 Posting Whiz in Training
Adak 419 Nearly a Posting Virtuoso
histrungalot 32 Junior Poster
gourav1 -12 Posting Whiz in Training
TrustyTony 888 ex-Moderator Team Colleague Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.