Skip to content

Commit 619fd99

Browse files
feat: math functions
1 parent 34c58a4 commit 619fd99

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

09_math.php

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
3+
/*
4+
* All Math functions: https://www.w3schools.com/php/php_ref_math.asp
5+
* */
6+
7+
// pi() Function
8+
echo "<pre/>======== pi() ======== <pre/>";
9+
echo(pi());
10+
11+
// min() Function
12+
echo "<pre/>======== min() ======== <pre/>";
13+
echo(min(0, 150, 30, 20, -8, -200));
14+
15+
// max() Function
16+
echo "<pre/>======== max() ======== <pre/>";
17+
echo(max(0, 150, 30, 20, -8, -200));
18+
19+
// abs() Function
20+
echo "<pre/>======== abs() ======== <pre/>";
21+
echo(abs(-5.69));
22+
23+
// sqrt() Function
24+
echo "<pre/>======== sqrt() ======== <pre/>";
25+
echo(sqrt(16));
26+
27+
// round() Function
28+
echo "<pre/>======== round() ======== <pre/>";
29+
echo(round(0.50));
30+
echo "<pre/>";
31+
echo(round(0.49));
32+
33+
// rand() Function
34+
echo "<pre/>======== rand() ======== <pre/>";
35+
echo(rand());
36+
37+
// rand() range Function
38+
echo "<pre/>======== rand() range ======== <pre/>";
39+
echo(rand(10, 100));

10_array.php

Whitespace-only changes.

0 commit comments

Comments
 (0)