<?php
float exp ( float $num )
where,
$num = The argument to process
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
e = 2.718281828459045235360287471352662497757247
09369995957496696762772407663035354759457138
21785251664274274663919320030599218174135966
29043572900334295260595630738132328627943490
76323382988075319525101901157383418793070215408...
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
?>
<?php
$exp01 = 6;
$topower01 = exp($exp01);
$pow01 = pow(M_E, $exp01);
if(PHP_MAJOR_VERSION <= 7)
{
setlocale(LC_ALL, "en_US", "en-US");
echo 'American English<br><br>exp(' . $exp01 . ') = ' . $topower01 . '<br><br>the same as<br><br>';
echo 'pow(' . M_E . ', ' . $exp01 . ') = ' . $pow01 . '<br><br><br><br><br>';
setlocale(LC_ALL, "pt_PT.utf-8", "pt-PT");
echo 'Portugal - Portuguese<br><br>exp(' . $exp01 . ') = ' . $topower01 . '<br><br>o mesmo que<br><br>';
echo 'pow(' . M_E . ', ' . $exp01 . ') = ' . $pow01;
}
else
{
echo 'exp(' . $exp01 . ') = ' . $topower01 . '<br><br>the same as<br><br>';
echo 'pow(' . M_E . ', ' . $exp01 . ') = ' . $pow01 . '<br>';
}
?>
<?php
// Run thiis code several times
$exp02 = mt_rand(-6, 6);
$topower02 = exp($exp02);
$pow02 = pow(M_E, $exp02);
if(PHP_MAJOR_VERSION <= 7)
{
setlocale(LC_ALL, "en_US", "en-US");
echo 'American English<br><br>exp(' . $exp02 . ') = ' . $topower02 . '<br><br>the same as<br><br>';
echo 'pow(' . M_E . ', ' . $exp02 . ') = ' . $pow02 . '<br><br><br><br><br>';
setlocale(LC_ALL, "fr_FR.utf-8", "fr-FR");
echo 'France - French<br><br>exp(' . $exp02 . ') = ' . $topower02 . '<br><br>même que<br><br>';
echo 'pow(' . M_E . ', ' . $exp02 . ') = ' . $pow02;
}
else
{
echo 'exp(' . $exp02 . ') = ' . $topower02 . '<br><br>the same as<br><br>';
echo 'pow(' . M_E . ', ' . $exp02 . ') = ' . $pow02 . '<br>';
}
?>
<?php
$arg03a = M_PI;
$arg03b = (exp($arg03a) - exp(-$arg03a))/2;
if(PHP_MAJOR_VERSION <= 7)
{
setlocale(LC_ALL, "en_GB", "en-GB");
echo '(exp( ' . $arg03a . ' ) - exp( ' . -$arg03a . '))/2 = <br><br>';
echo ' = ' . $arg03b . '<br>( en_GB or en-GB )<br><br>';
setlocale(LC_ALL, "de_DE.utf-8", "de-DE");
echo '(exp( ' . $arg03a . ' ) - exp( ' . -$arg03a . '))/2 = <br><br>';
echo ' = ' . $arg03b . '<br>( de_DE or de-DE )<br><br>';
}
else
{
echo '(exp( ' . $arg03a . ' ) - exp( ' . -$arg03a . '))/2 = <br><br>';
echo ' = ' . $arg03b . '<br>';
}
?>
<?php
$arg04a = M_PI;
$arg04b = (exp($arg04a) + exp(-$arg04a))/2;
if(PHP_MAJOR_VERSION <= 7)
{
setlocale(LC_ALL, "en_US", "en-US");
echo '(exp( ' . $arg04a . ' ) + exp( ' . -$arg04a . '))/2 = <br><br>';
echo ' = ' . $arg04b . '<br>( en_US )<br><br>';
setlocale(LC_ALL, "fr_FR.utf-8", "fr-FR", "fr");
echo '(exp( ' . $arg04a . ' ) + exp( ' . -$arg04a . '))/2 = <br><br>';
echo ' = ' . $arg04b . '<br>( fr_FR )<br><br>';
}
else
{
echo '(exp( ' . $arg04a . ' ) + exp( ' . -$arg04a . '))/2 = <br><br>';
echo ' = ' . $arg04b . '<br>';
}
?>