Proposal for "Math_AP"

» Metadata » Status
  • Category: Math
  • Proposer: tc 
  • License: PHP License
» Description
The Math_AP class calculates with Arbitary Precesion. It works with Bcmath php extension. It has defined trigonometric functions, hyperbolic functions and so one.

For example:

<?php
require_once "Math/AP.php";

$num1 = "3.12";
$num2 = "2.14";

$add = Math_AP::add($num1,$num2,100); // sum of $num1 and $num2
$sub = Math_AP::sub($num1,$num2,100); // difference of $num1 and $num2
$mult = Math_AP::mult($num1,$num2,100); // product of $num1 and $num2
$div = Math_AP::div($num1,$num2,100); // division of $num1 and $num2
$pow = Math_AP::pow($num1,$num2,100); // power $num1 by $num2

$log = Math_AP::log($num1,$num2,100); // logarithm of $num1 by base $num2
$exp = Math_AP::exp($num1,100); // e^$num1
$abs = Math_AP::abs($num1,100); // absolute value of $num1

$sin = Math_AP::sin("1.234",100); // sine
$cosh = Math_AP::cosh("1.234",100); // hyperbolic cosine
$atanh = Math_AP::atanh("0.1234",100); // inverse hyperbolic tangent

$pi = Math_AP::pi(100);
?>
» Dependencies » Links
  • php zlib extension
  • php bcmath extension
  • PEAR
» Timeline » Changelog
  • First Draft: 2006-01-04
  • Proposal: 2006-01-12
  • Call for Votes: 2006-01-19
  • Voting Extended: 2006-01-27