<?php
float log ( float $num, float $base = M_E )
where,
$num = The argument to process
$base = The optional logarithmic base to use
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
M_E = e = 2.718281828459045235360287471352662497757247
09369995957496696762772407663035354759457138
21785251664274274663919320030599218174135966
29043572900334295260595630738132328627943490
76323382988075319525101901157383418793070215
408...
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
?>
<table width="100%" border="1" cellspacing="5" cellpadding="5">
<tr><td colspan="4">NATURAL LOGARITHM VALUES</td></tr>
<tr><td>CONSTANT</td><td>VALUE</td><td>OPERATION</td><td>RESULT</td></tr>
<?php
// setlocale(LC_ALL, 'pt-PT', 'pt_PT');
$l01_a = [ 'PHP_INT_MIN' => PHP_INT_MIN,
'PHP_FLOAT_MIN' => PHP_FLOAT_MIN,
'0' => 0, 'e' => M_E,
'PHP_INT_MAX' => PHP_INT_MAX,
'PHP_FLOAT_EPSILON' => PHP_FLOAT_EPSILON,
'PHP_FLOAT_MAX' => PHP_FLOAT_MAX ];
foreach($l01_a as $wis => $val)
{
echo '<td>' . $wis . '</td>';
echo '<td>' . $val . '</td>';
echo '<td>log( ' . $val . ' )</td><td>' . log($val) . '</td></tr>';
}
?>
<td colspan="4">ed48</td></tr></table>
<table width="100%" border="1" cellspacing="5" cellpadding="5">
<tr><td colspan="4">BASE 10 LOGARITHM VALUES</td></tr>
<tr><td>CONSTANT</td><td>VALUE</td><td>OPERATION</td><td>RESULT</td></tr>
<?php
// setlocale(LC_ALL, 'pt-PT', 'pt_PT');
$l02_a = [ 'PHP_INT_MIN' => PHP_INT_MIN,
'PHP_FLOAT_MIN' => PHP_FLOAT_MIN,
'0' => 0, '10' => 10,
'PHP_INT_MAX' => PHP_INT_MAX,
'PHP_FLOAT_EPSILON' => PHP_FLOAT_EPSILON,
'PHP_FLOAT_MAX' => PHP_FLOAT_MAX ];
foreach($l02_a as $wis => $val)
{
echo '<td>' . $wis . '</td>';
echo '<td>' . $val . '</td>';
echo '<td>log( ' . $val . ', 10 )</td><td>' . log($val, 10) . '</td></tr>';
}
?>
<td colspan="4">ed48</td></tr></table>
<?php
// Run this code several times
// setlocale(LC_ALL, 'fr_FR', 'fr-FR', 'fr');
$base03 = mt_rand(2, 9);
?>
<table width="100%" border="1" cellspacing="5" cellpadding="5">
<tr><td colspan="4">VALEURS LOGARITHMES DE BASE <?php echo $base03; ?></td></tr>
<tr><td>CONSTANTE</td><td>VALEUR</td><td>OPERATION</td><td>RÉSULTAT</td></tr>
<?php
$l03_a = [ 'PHP_INT_MIN' => PHP_INT_MIN,
'PHP_FLOAT_MIN' => PHP_FLOAT_MIN,
'0' => 0, 'BASE' => $base03,
'PHP_INT_MAX' => PHP_INT_MAX,
'PHP_FLOAT_EPSILON' => PHP_FLOAT_EPSILON,
'PHP_FLOAT_MAX' => PHP_FLOAT_MAX ];
foreach($l03_a as $wis => $val)
{
echo '<td>' . $wis . '</td>';
echo '<td>' . $val . '</td>';
echo '<td>log( ' . $val . ', ' . $base03 . ' )</td><td>' . log($val, $base03) . '</td></tr>';
}
?>
<td colspan="4">ed48</td></tr></table>