![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Expert Programmer
|
JDstud6's CPU speed test.
I converted JDStud6's cpu tester to php. I want to make sure it works properly... but i have never used fractorials? Is the fractorial of 6 == 720?
[php] <?php function Factorial($n) { if($n==1){ return $n; } else { return Factorial($n-1)*$n; } } ; $timeArray=getdate(); $tempOne=$timeArray['seconds']; $startMili=time(); print (Factorial(6)); $tempTwo=($timeArray['seconds']); $endMili=time(); $endMili-=$startMili; $tempTwo-=$tempOne; print ("\nStart: $tempOne sec & $startMili ms\nEnd tempTwo sec & $endMili ms\n");?> [/php]
__________________
"When in Rome, Do as the Romans Do" "Beauty is in the eye of the BEER holder" "Save your breath your going to need it for your blow up doll later" SearchLores.org |
|
|
|
|
|
#2 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Yes, the factorial (no 'r' after 'f') of 6 is 720: 6*5*4*3*2*1.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|