GENERAL MATHEMATICS 




MATHEMATICS

To those who believe in GOD:

MATHEMATICS is the language in which HE wrote the UNIVERSE.

MATHEMATICS, (from Greek μάθημα máthēma, "knowledge, study, learning"), includes the study of such topics as quantity, (number theory), structure (algebra), space (geometry), and change (mathematical analysis).

However, there is no general definition.


BC MATH functions

For arbitrary precision mathematics PHP offers the Binary Calculator which supports numbers of any size and precision up to 2147483647, (or 0x7FFFFFFF), decimals, if there is sufficient memory, represented as strings.


GMP function

These functions allow for arbitrary-length integers to be worked with using the GNU MP library.

The GMP can be either a GMP OBJECT, an INTEGER or an INTEGER NUMERIC STRING provided that it is possible to convert the latter to a number.


This tutorial covers all the major possible mathematical functions available in PHP.


Additional Useful Links

   GNU - Multiple Precision  !

   Portal:Mathematics  !

   Examples for Mathematics  !

   W3C Math Home - MathML  !

   Mathematics WWW Virtual Library  !

   MIT OPEN CURSEWARE  !






In this tutorial, we make extensive use of constans and variables built into the system, so it's a good idea to perform the following exercises to check their definitions.

Internal constants and internal variables depend on the system in use.

Of course, such constants or variables can be defined by the user created by the function: define.



  1 EXERCISE   

<style>
@font-face { font-family: Philo; src: url(attf/philo/Philosopher-Italic.ttf);}

.t1 { font-family: Philo; background-color:#00CCFF; font-size:12px; text-align:center;}
.t2 { font-family: Philo; background-color:white; font-size:12px; }
.t14 { font-family: Philo; background-color:#00CCFF; font-size:16px; text-align:center;}
</style>

<div class="circ bfff"><table width="100%" cellspacing="5" 
cellpadding="5" border="1">
<tbody>
<tr class="t14"><td colspan="2">INTERNAL CONSTANTS<br>
<?php  echo 'PHP ' PHP_VERSION '<br>' PHP_VERSION_ID?></td></tr>
<tr class="t1">

<td>CONTANT NAME</td><td>VALUE</td>
</tr>

<?php

$arr 
get_defined_constants(false);

foreach (
$arr as $k => $v)

echo 
"<tr><td>$k</td><td>$v</td></tr>";
}

?>
<tr class="t1">
<td colspan="2">ed48</td>
</tr>
</tbody></table></div><br>

  2 EXERCISE   

<style>
@font-face { font-family: Philo; src: url(attf/philo/Philosopher-Italic.ttf);}

.t1 { font-family: Philo; background-color:#00CCFF; font-size:12px; text-align:center;}
.t2 { font-family: Philo; background-color:white; font-size:12px; }
.t14 { font-family: Philo; background-color:#00CCFF; font-size:16px; text-align:center;}
</style>

<div class="circ bfff"><table width="100%" cellspacing="5" 
cellpadding="5" border="1">
<tbody>
<tr class="t14"><td colspan="2">INTERNAL VARIABLES<br>
<?php  echo 'PHP ' PHP_VERSION '<br>' PHP_VERSION_ID?></td></tr>
<tr class="t1">

<td width="35%">VARIABLE NAME</td>
<td>VALUE</td>
</tr>        
<?php

$var 
$_SERVER;
$c 0;
foreach(
$var as $k => $v)
{
$c++;
?>  
<tr class="t2">

<td><?php echo $k?></td>
<?php
if(!is_array($v))
{
?>
<td><?php echo $v?></td></tr>
<?php
}
else
{
?>
<td><?php var_dump($v); ?></td></tr>

<?php } } ?>

<tr class="t1">
<td colspan="2">ed48</td>
</tr>
</tbody></table></div><br>