Source Code:
(back to article)
<?php $num1 = -10; $num2 = 2.7; // Absolute value $result = abs($num1); echo "abs(\$num1) = "; echo $result . "\n"; // 10 // Round up $result = ceil($num2); echo "ceil(\$num2) = "; echo $result . "\n"; // 3 // Round down $result = floor($num2); echo "floor(\$num2) = "; echo $result . "\n"; // 2 // Square root $result = sqrt(9); echo "sqrt(9) = "; echo $result . "\n"; // 3 // Raise to power $result = pow(2, 3); echo "pow(2, 3) = "; echo $result; // 8 ?>
Result:
Report an issue