Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Dec 18th, 2005, 5:26 PM   #1
Kilo
Expert Programmer
 
Kilo's Avatar
 
Join Date: Nov 2005
Location: In Pink Clam?
Posts: 542
Rep Power: 0 Kilo is an unknown quantity at this point
Send a message via AIM to Kilo
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\nEndtempTwo 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
Kilo is offline   Reply With Quote
Old Dec 18th, 2005, 6:01 PM   #2
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
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
DaWei is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 11:09 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC