Judul : PHP MATH FUNCTIONS
link : PHP MATH FUNCTIONS
PHP MATH FUNCTIONS
PHP Math: abs() function
The abs() function returns absolute value of given number. It returns an integer value but if you pass floating point value, it returns a float value.
SyntaxExample
Output:
7
7
7.2
PHP Math: ceil() function
The ceil() function rounds fractions up.
SyntaxExample
Output:
4
8
-4
PHP Math: floor() function
The floor() function rounds fractions down.
SyntaxExample
Output:
3
7
-5
PHP Math: sqrt() function
The sqrt() function returns square root of given argument.
SyntaxExample
Output:
4
5
2.6457513110646
PHP Math: decbin() function
The decbin() function converts decimal number into binary. It returns binary number as a string.
SyntaxExample
Output:
10
1010
10110
PHP Math: dechex() function
The dechex() function converts decimal number into hexadecimal. It returns hexadecimal representation of given number as a string.
SyntaxExample
Output:
2
a
16
PHP Math: decoct() function
The decoct() function converts decimal number into octal. It returns octal representation of given number as a string.
SyntaxExample
Output:
2
12
26
PHP Math: base_convert() function
The base_convert() function allows you to convert any base number to any base number. For example, you can convert hexadecimal number to binary, hexadecimal to octal, binary to octal, octal to hexadecimal, binary to decimal etc.
SyntaxExample
Output:
1010
PHP Math: bindec() function
The bindec() function converts binary number into decimal.
SyntaxExample
Output:
2
10
11
Demikianlah Artikel PHP MATH FUNCTIONS
Sekianlah artikel PHP MATH FUNCTIONS kali ini, mudah-mudahan bisa memberi manfaat untuk anda semua. baiklah, sampai jumpa di postingan artikel lainnya.
Anda sekarang membaca artikel PHP MATH FUNCTIONS dengan alamat link https://othereffect.blogspot.com/2016/02/php-math-functions.html
0 Response to "PHP MATH FUNCTIONS"
Post a Comment