Ambiguously Gendered Return of 'What is the Hivemind?'

Status
Not open for further replies.

Steve Jung

Explorer
Rystil Arden said:
The elegant solution I haven't mentioned yet. It works in logarithmic time (so if you want the 1267650600228229401496703205376th Fibonacci number, I can get it for you in 100 steps...
Alright, Mr. Smarty-pants what is the 1267650600228229401496703205376th Fibonacci number? (Man. I love cut-and-paste.) :)
 

log in or register to remove this ad


Rystil Arden

First Post
Steve Jung said:
Alright, Mr. Smarty-pants what is the 1267650600228229401496703205376th Fibonacci number? (Man. I love cut-and-paste.) :)
Dude, I dunno. I don't have my compiler at home :D

Wanna know the special secret to get it fast?
 


Rystil Arden

First Post
Steve Jung said:
OK. Shoot.
OK, so there's two steps to this one. The first is something that seems unrelated: Ready? OK, you know about exponents and stuff, right? Like 5 to the 8th power = 5*5*5*5*5*5*5*5 right? Well that can take forever to calculate if you do it linearly like that, so look at this shortcut:

5 to the 8th power =

(5 squared) to the 4th power =

25 to the 4th power =

(25 squared) squared =

625 squared = 390625

Or:

5*5*5*5*5*5*5*5 =
(5*5)*(5*5)*(5*5)*(5*5) =
25*25*25*25 =
(25*25)*(25*25) =
(625*625) =
390625

This can save you massive amounts of time if you try to calculate 2 to the 128th power, for instance. In fact, this is logarithmic

Got it so far?
 






Status
Not open for further replies.
Remove ads

AD6_gamerati_skyscraper

Remove ads

Recent & Upcoming Releases

Top