[Quantproject-developers] QuantProject/b1_ADT ExtendedMath.cs, NONE, 1.1
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2006-09-08 15:18:31
|
Update of /cvsroot/quantproject/QuantProject/b1_ADT In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv3469/b1_ADT Added Files: ExtendedMath.cs Log Message: Mathematical function provider --- NEW FILE: ExtendedMath.cs --- using System; namespace QuantProject.ADT { /// <summary> /// Mathematical function provider /// </summary> public class ExtendedMath { public ExtendedMath() { // // TODO: Add constructor logic here // } public static long Factorial( int n ) { if ( n < 0 ) throw new Exception( "Factorial is undefined for n<0!" ); long factorial; if ( ( n == 0 ) || ( n == 1 ) ) factorial = 1; else factorial = n * Factorial( n - 1 ); return factorial; } } } |