PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Travis Conway   Simple Math   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example of using lsSimpleMath
Class: Simple Math
Calculate factorials, permutations and combination
Author: By
Last change:
Date: 16 years ago
Size: 448 bytes
 

Contents

Class file image Download
<PRE>
Test for lsSimpleMath.
<?
   
require_once("lsSimpleMath.class.php");

   
$lsSimpleMath = new lsSimpleMath();
    print(
"5! should equal 120\n");
   
printf("\t5! = %u\n", $lsSimpleMath->Factorial(5));
    print(
"P 10,3 should equal 720\n");
   
printf("\tP 10,3 = %u\n", $lsSimpleMath->Permutation(10,3));
    print(
"C 52,5 should equal 2598960\n");
   
printf("\t C 52,5 = %u\n", $lsSimpleMath->Combination(52,5));
?>
</PRE>