<html>
<body bgcolor=lightyellow>
<H1 Align=center>Number Functions</h1>
<?php
// floor/ceil and round --------------------------------------------
$num = 1234.5567;
print "<b>floor(1234.5567) is......: </b>" . floor($num);
print "<br>";
print "<b>ceil(1234.5567) is........: </b>" . ceil($num);
print "<br>";
print "<b>round(1234.5567, 2) is: </b>" . round($num, 2);
print "<hr>";
// generating random numbers ---------------------------------------
print "<b>The random number for rand( ) is.....: </b>" . rand( );
print "<br>";
print "<b>The random number for rand(1, 6) is: </b>" . rand(1,6);
print "<hr>";
// printing a number in binary/octal/hex ---------------------------
$num = 123458;
print "<b>The number " . $num . " in binary is: </b>" . decbin($num);
print "<br>";
print "<b>The number " . $num . " in octal is..: </b>" . decoct($num);
print "<br>";
print "<b>The number " . $num . " in hex is....: </b>" . dechex($num);
print "<hr>";
// power and square root -------------------------------------------
print "<b>pow(123.45, 2) is....: </b>" . pow(123.45, 2);
print "<br>";
print "<b>sqrt(15239.9025) is: </b>" . sqrt(15239.9025);
print "<hr>";
?>
<?php include "../include.php"; ?> <!-- hyperlink to see the code -->
</body>
</html>