"> ">

Presentation is loading. Please wait.

Presentation is loading. Please wait.

Php – Math functions. FunctionDescription abs()Returns the absolute value of a number ceil()Returns the value of a number rounded upwards to the nearest.

Similar presentations


Presentation on theme: "Php – Math functions. FunctionDescription abs()Returns the absolute value of a number ceil()Returns the value of a number rounded upwards to the nearest."— Presentation transcript:

1 php – Math functions

2 FunctionDescription abs()Returns the absolute value of a number ceil()Returns the value of a number rounded upwards to the nearest integer floor()Returns the value of a number rounded downwards to the nearest integer is_nan()Returns true if a value is not a number lcg_value()Returns a pseudo random number in the range of (0,1) max()Returns the number with the highest value of two specified numbers min()Returns the number with the lowest value of two specified numbers pow()Returns the value of x to the power of y mt_rand()Returns a random integer using Mersenne Twister algorithm rand()Returns a random integer round()Rounds a number to the nearest integer sqrt()Returns the square root of a number 常用數學函數

3 亂數 float lcg_value () 產生介於 0 與 1 之浮點亂數 int mt_rand(min, max) int rand(min, max) 產生介於 min 與 max 之整數亂數 <?php echo lcg_value()." "; echo rand(1,49)." "; echo mt_rand(1,49)." "; ?>

4 四捨五入

5 二, 八, 十, 十六進位轉換 base_convert()Converts a number from one base to another bindec()Converts a binary number to a decimal number decbin()Converts a decimal number to a binary number dechex()Converts a decimal number to a hexadecimal number decoct()Converts a decimal number to an octal number hexdec()Converts a hexadecimal number to a decimal number octdec()Converts an octal number to a decimal number


Download ppt "Php – Math functions. FunctionDescription abs()Returns the absolute value of a number ceil()Returns the value of a number rounded upwards to the nearest."

Similar presentations


Ads by Google