- Dưới đây là danh sách các hàm toán học được xây dựng sẵn trong PHP.
sin[] | - Trả về sin của một số. |
sinh[] | - Trả về sin hyperbolic của một số. |
cos[] | - Trả về cosin của một số. |
cosh[] | - Trả về cosin hyperbolic của một số. |
tan[] | - Trả về tan của một số. |
tanh[] | - Trả về tan hyperbolic của một số. |
asin[] | - Trả về sin cung của một số. |
asinh[] | - Trả về sin hyperbolic nghịch đảo của một số. |
acos[] | - Trả về cosin cung của một số. |
acosh[] | - Trả về cosin hyperbolic nghịch đảo của một số. |
atan[] | - Trả về tan cung của một số. |
atanh[] | - Trả về tan hyperbolic nghịch đảo của một số. |
atan2[] | - Trả về tan cung của hai biến x & y. |
round[] | - Làm tròn đến số nguyên gần nhất. |
ceil[] | - Làm tròn [lên] đến số nguyên gần nhất. |
floor[] | - Làm tròn [xuống] đến số nguyên gần nhất. |
base_convert[] | - Chuyển đổi một số từ “cơ số này” “cơ số khác” |
bindec[] | - Chuyển đổi “số nhị phân” “số thập phân” |
octdec[] | - Chuyển đổi “số bát phân” “số thập phân” |
decbin[] | - Chuyển đổi “số thập phân” “số nhị phân” |
decoct[] | - Chuyển đổi “số thập phân” “số bát phân” |
dechex[] | - Chuyển đổi “số thập phân” “số thập lục phân” |
hexdec[] | - Chuyển đổi “số thập lục phân” “số thập phân” |
deg2rad[] | - Chuyển đổi số đo [độ] của một góc thành giá trị radian. |
rad2deg[] | - Chuyển đổi giá trị radian thành số đo [độ] của một góc. |
is_finite[] | - Kiểm tra xem giá trị có phải là một “số hữu hạn” hay không. |
is_infinite[] | - Kiểm tra xem giá trị có phải là một “số vô hạn” hay không. |
is_nan[] | - Kiểm tra xem giá trị có phải là một giá trị “không phải là số [not a number]” hay không. |
pow[] | - Tính lũy thừa. |
exp[] | - Tính lũy thừa của cơ số e. |
expm1[] | - Trả về exp[x] - 1 |
sqrt[] | - Trả về giá trị “căn bậc hai” của một số. |
intdiv[] | - Chia lấy phần nguyên. |
fmod[] | - Trả về phần “số dư” từ một phép chia lấy phần nguyên. |
min[] | - Trả về “số nhỏ nhất” trong một tập hợp các số [có thể là một danh sách các số, hoặc một mảng các số] |
max[] | - Trả về “số lớn nhất” trong một tập hợp các số [có thể là một danh sách các số, hoặc một mảng các số] |
rand[] | - Trả về một “số nguyên ngẫu nhiên” trong phạm vi chỉ định. |
mt_rand[] | -- Trả về một “số nguyên ngẫu nhiên” trong phạm vi chỉ định [dựa trên thuật toán Mersenne Twister] |
getrandmax[] | - Trả về “giá trị lớn nhất” có thể được trả về bởi hàm rand[]. |
mt_getrandmax[] | - Trả về “giá trị lớn nhất” có thể được trả về bởi hàm mt_rand[]. |
lcg_value[] | - Trả về một “số thập phân ngẫu nhiên” trong khoảng 0 - 1 |
log[] | - Trả về logarit tự nhiên của một số. |
log10[] | - Trả về logarit cơ số 10 của một số. |
log1p[] | - Trả về log[1+number] |
abs[] | - Trả về “giá trị tuyệt đối” của một số. |
pi[] | - Trả về giá trị của PI. |
hypot[] | - Tính cạnh huyền của một tam giác vuông. |
botvietbai.com cung cấp các hướng dẫn, tài liệu tham khảo và bài tập trực tuyến miễn phí bằng tất cả các ngôn ngữ chính của web. Bao gồm các chủ đề phổ biến như HTML, CSS, JavaScript, Python, SQL, Java, và nhiều hơn nữa.
Hits: 59
- Các hàm toán học trong PHP
- Giới thiệu Toán PHP
- Cài đặt
- Các hàm toán học trong PHP
- Các hằng số toán học được xác định trước
trong PHP
- Related posts:
❮ Trước
Tiếp theo ❯
Giới thiệu Toán PHP
Các hàm toán học có thể xử lý các giá trị trong phạm vi của kiểu số nguyên và số thực.
Cài đặt
Các hàm toán học PHP là một phần của lõi PHP. Không cần cài đặt để sử dụng các chức năng này.
Các hàm toán học trong PHP
abs[] | Returns the absolute [positive] value of a number |
acos[] | Returns the arc cosine of a number |
acosh[] | Returns the inverse hyperbolic cosine of a number |
asin[] | Returns the arc sine of a number |
asinh[] | Returns the inverse hyperbolic sine of a number |
atan[] | Returns the arc tangent of a number in radians |
atan2[] | Returns the arc tangent of two variables x and y |
atanh[] | Returns the inverse hyperbolic tangent of a number |
base_convert[] | Converts a number from one number base to another |
bindec[] | Converts a binary number to a decimal number |
ceil[] | Rounds a number up to the nearest integer |
cos[] | Returns the cosine of a number |
cosh[] | Returns the hyperbolic cosine of a 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 |
deg2rad[] | Converts a degree value to a radian value |
exp[] | Calculates the exponent of e |
expm1[] | Returns exp[x] – 1 |
floor[] | Rounds a number down to the nearest integer |
fmod[] | Returns the remainder of x/y |
getrandmax[] | Returns the largest possible value returned by rand[] |
hexdec[] | Converts a hexadecimal number to a decimal number |
hypot[] | Calculates the hypotenuse of a right-angle triangle |
intdiv[] | Performs integer division |
is_finite[] | Checks whether a value is finite or not |
is_infinite[] | Checks whether a value is infinite or not |
is_nan[] | Checks whether a value is ‘not-a-number’ |
lcg_value[] | Returns a pseudo random number in a range between 0 and 1 |
log[] | Returns the natural logarithm of a number |
log10[] | Returns the base-10 logarithm of a number |
log1p[] | Returns log[1+number] |
max[] | Returns the highest value in an array, or the highest value of several specified values |
min[] | Returns the lowest value in an array, or the lowest value of several specified values |
mt_getrandmax[] | Returns the largest possible value returned by mt_rand[] |
mt_rand[] | Generates a random integer using Mersenne Twister algorithm |
mt_srand[] | Seeds the Mersenne Twister random number generator |
octdec[] | Converts an octal number to a decimal number |
pi[] | Returns the value of PI |
pow[] | Returns x raised to the power of y |
rad2deg[] | Converts a radian value to a degree value |
rand[] | Generates a random integer |
round[] | Rounds a floating-point number |
sin[] | Returns the sine of a number |
sinh[] | Returns the hyperbolic sine of a number |
sqrt[] | Returns the square root of a number |
srand[] | Seeds the random number generator |
tan[] | Returns the tangent of a number |
tanh[] | Returns the hyperbolic tangent of a number |
Các hằng số toán học được xác định trước trong PHP
INF | INF | The infinite |
M_E | 2.7182818284590452354 | Returns e |
M_EULER | 0.57721566490153286061 | Returns Euler constant |
M_LNPI | 1.14472988584940017414 | Returns the natural logarithm of PI: log_e[pi] |
M_LN2 | 0.69314718055994530942 | Returns the natural logarithm of 2: log_e 2 |
M_LN10 | 2.30258509299404568402 | Returns the natural logarithm of 10: log_e 10 |
M_LOG2E | 1.4426950408889634074 | Returns the base-2 logarithm of E: log_2 e |
M_LOG10E | 0.43429448190325182765 | Returns the base-10 logarithm of E: log_10 e |
M_PI | 3.14159265358979323846 | Returns Pi |
M_PI_2 | 1.57079632679489661923 | Returns Pi/2 |
M_PI_4 | 0.78539816339744830962 | Returns Pi/4 |
M_1_PI | 0.31830988618379067154 | Returns 1/Pi |
M_2_PI | 0.63661977236758134308 | Returns 2/Pi |
M_SQRTPI | 1.77245385090551602729 | Returns the square root of PI: sqrt[pi] |
M_2_SQRTPI | 1.12837916709551257390 | Returns 2/square root of PI: 2/sqrt[pi] |
M_SQRT1_2 | 0.70710678118654752440 | Returns the square root of 1/2: 1/sqrt[2] |
M_SQRT2 | 1.41421356237309504880 | Returns the square root of 2: sqrt[2] |
M_SQRT3 | 1.73205080756887729352 | Returns the square root of 3: sqrt[3] |
NAN | NAN | Not A Number |
PHP_ROUND_HALF_UP | 1 | Round halves up |
PHP_ROUND_HALF_DOWN | 2 | Round halves down |
PHP_ROUND_HALF_EVEN | 3 | Round halves to even numbers |
PHP_ROUND_HALF_ODD | 4 | Round halves to odd numbers |
❮ Trước
Tiếp theo ❯
botvietbai.com