Logarithms

Ypu want to take the logarithm of a number.

use the following functions:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="EN" lang="EN">
<head>
<title>Logarithms</title>
<meta Name="Author" Content="Hann So">
</head>
<body>
<p>
<?php
$num = 10;
echo "log($num): ", log($num), "<br />"; // base e
echo "log10($num): ", log10($num), "<br />"; // base 10
echo "log($num, 2): ", log($num, 2), "<br />"; // base 2
?>
</p>
</body>
</html>

View the effect


Numbers | Introduction | Checking a Valid Number | Comparing FLoating-Point Numbers | Rounding FLoating-Point Numbers | Series of Integers | Random Numbers | Logarithms | Exponents | Formatting Numbers | Formatting Monetary Values | Printing Correct Plurals | Trigonometric Functions | Converting Between Bases
© 2008: Hann So
email: hso@voyager.deanza.edu