forked from assembler-institute/php-basics
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmaths.php
More file actions
21 lines (16 loc) · 810 Bytes
/
maths.php
File metadata and controls
21 lines (16 loc) · 810 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
// Define a variable whose value is the result of the function that returns an absolute value.
$v1 = abs(-4.2);
echo $v1."<br>";
// Define a variable whose value is the result of the function that returns a rounded value to the next highest integer.
$v2 = round(4.8);
echo $v2."<br>";
// Define a variable whose value is the result of the function that returns the highest value of a series of values that are received by parameter.
$v3 = max(9, 1, 2, 15);
echo $v3."<br>";
// Define a variable whose value is the result of the function that returns the lowest value of a series of values that are received by parameter.
$v4 = min(9, 1, 2, 15);
echo $v4."<br>";
// Define a variable whose value is the result of the function that returns a random number
$v5 = mt_rand();
echo $v5."<br>";