|
|
|
#1 (permalink) | ||||||||||||
|
Intel Overclocker
![]() |
PHP Code:
Any idea how to do that?
__________________
|
||||||||||||
|
|
|
|
|
#2 (permalink) | ||||||||||||||
|
Graphics Card Aficionado
![]() |
Quote:
That should do it. My C/C++ is a bit rusty... edit: forgot ";'s" edit 3, maybe 4 or 5: Added .exe
__________________
I'm not terribly active at the moment...I'm caught up in school and such, so you have my advance apology if I don't respond to a post/PM the way I usually do. Project: Sruth de athrú - An un-decided and slow-moving techstation project.
Last edited by Error 404 : 3 Weeks Ago at 11:50 PM Reason: bah. Doesn't take BBcode in [php] tags |
||||||||||||||
|
|
|
|
|
#3 (permalink) | |||||||||||||
|
New to Overclock.net
|
that will work.
__________________then just print num after the call. Absolutely horrible way to calculate fibonacci numbers though. very wasteful. As you shall see.
|
|||||||||||||
|
|
|
|
|
#4 (permalink) | |||||||||||
|
Programmer
|
have fib increment a global variable at the beginning of each function call.
__________________
i7 920
CPU-Z 4.45GHz PCPitstop score 15,225 SuperPi 1M 9.344s Turion x2 TL-68 @ 2.7GHz PCPitstop score 4,258 #1 hwbot.org cpu-z #1 hwbot.org SuperPi (36.80)
|
|||||||||||
|
|
|
|
|
#5 (permalink) | ||||||||||||||
|
Intel Overclocker
![]() |
Quote:
Quote:
what do you mean? how would i do that?
__________________
|
||||||||||||||
|
|
|
|
|
#6 (permalink) | |||||||||||||
|
Graphics Card Aficionado
![]() |
I edited the code in your quotes
![]() It works, too. Bonus!
__________________
I'm not terribly active at the moment...I'm caught up in school and such, so you have my advance apology if I don't respond to a post/PM the way I usually do. Project: Sruth de athrú - An un-decided and slow-moving techstation project.
|
|||||||||||||
|
|
|
|
|
#7 (permalink) | |||||||||||||
|
Nom nom nom..
![]()
Join Date: Jul 2007
Location: California, USA
Posts: 2,979
Rep: 254
![]() ![]() ![]() Unique Rep: 209
Trader Rating: 2
|
Code:
if (n == 0 || n == 1){
return 1;
}
else {
sum = (Fib(n-1) + Fib(n-2));
return sum;
}
You want this as a recursive function that calls itself.
__________________
Blizzie Κατεψυγμένα Στερεά Hold on to the calm before the storm comes
|
|||||||||||||
|
|
|
|
#8 (permalink) | |||||||||||||
|
Programmer
|
Quote:
Quote:
__________________
i7 920
CPU-Z 4.45GHz PCPitstop score 15,225 SuperPi 1M 9.344s Turion x2 TL-68 @ 2.7GHz PCPitstop score 4,258 #1 hwbot.org cpu-z #1 hwbot.org SuperPi (36.80)
|
|||||||||||||
|
|
|
|
|
#9 (permalink) | ||||||||||||
|
Intel Overclocker
![]() |
PHP Code:
__________________
|
||||||||||||
|
|
|
|
|
#10 (permalink) | ||||||||||||
|
Intel Overclocker
![]() |
Thanks!
Edit: Thanks everyone for their help, it was helpful, REP++
__________________
Last edited by Mikey122687 : 3 Weeks Ago at 12:25 AM |
||||||||||||
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|