Working With Numbers | |
Using the Addition Operator ( + ) | Twenty plus thirty is 50 |
Using the Increment Operator (++) | Twenty incremented by one is 21 |
Using the Multiplication and Division Operators (* and /) |
Twenty times thirty divided by three plus two is 202 Twenty times thirty divided by (three plus two) is 120 |
Special Assignment Operators - Using += and *= |
Twenty plus_equals thirty is 50 Twenty time_equals thirty is 1500 |
Getting the absolute value of a number - Using abs () | The absolute value of 2.7 is 1500 |
Converting a binary number to a decimal number - Using bindec() | The decimal equivalent of the binary number 10101111 is 175 |
Round Numbers up or down - Using ceil () and floor () | < ?php $first_number = 2.4; echo "2.4 rounded up is " . ceil (first_number) . " and rounded down is " . floor ($first_number) . ""; ?> |
Finding the maximum or minimum value - Using max( ) and min( ) | The max value of 2,3,4 is 4, and the min value is 2/font> |
Get the value of PI - Using pi ( ) | The value ot PI is 3.1415926535898 |
Get a random number - Using rand( ) | A random number is 557523322/font> |
Get the square root - Using sqrt() | The square root of twenty is 4.4721359549996 |