## PHP Example #12

### Numbers

Numbers in PHP are expressed through a common notation; a point is used to separate decimals in float numbers and a negative sign can be written before the numbers to make them negative. Here are some examples:

print 56;

print nl2br("\n");

print 56.3;

print nl2br("\n");

print 0.774422;

print nl2br("\n");

print 16777.216;

print nl2br("\n");

print 0;

print nl2br("\n");

print -213;

print nl2br("\n");

print 1298317;

print nl2br("\n");

print -9912122;

print nl2br("\n");

print -12.52222;

print nl2br("\n");

print 0.00;

?>

56.3

0.774422

16777.216

0

-213

1298317

-9912122

-12.52222

0

## PHP Example #13

### Mathematical operations

Apart from the common operators, sum (+), rest (-), multiplication (*) and division (/), PHP also includes an operator for modulus
(%).

In PHP the operators have their priorities set as in the world of maths in general; for example, multiplication is prioritaire
over sum. So the expression 3 + 4 * 2 would give as result 11 and no 14. But you can use parenteses to specify your own rules
of precedency. So, the expression (3 + 4) * 2 would indeed give as result 14.

print 2 + 2;

print nl2br("\n");

print 17 - 3.5;

print nl2br("\n");

print 10 / 3;

print nl2br("\n");

print 6 * 9;

print nl2br("\n");

print 17 % 3;

?>

13.5

3.3333333333333

54

2