Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
PHP Articles
Page 77 of 81
is_infinite() function in PHP
The is_infinite() function checks if a value is infinite or not. It returns true if the number is an infinite number, else it returns false. Syntax is_infinite(num) Parameters num − The number to be checked. Return Value The is_infinite() function returns true if num is an infinite number, else it returns false. Example 1: Finite Number Let's check if a regular number is infinite ? false Example 2: Infinite Number Here we use log(0) which produces negative infinity ? ...
Read Moreis_finite() function in PHP
The is_finite() function checks if a value is finite or not. It returns true if the number is a finite number, else it returns false. Syntax is_finite(num) Parameters num − The number to be checked. Return Value The is_finite() function returns true if num is a finite number, else it returns false. Example 1: Finite Number Let's check if a regular number is finite ? true Example 2: Infinite Value Let's check if log(0) (which is negative infinity) is ...
Read Morehypot() function in PHP
The hypot() function is used to calculate the hypotenuse of a right-angle triangle. It returns the length of the hypotenuse as a float. In a right-angled triangle, the hypotenuse is the longest side opposite to the right angle. a b hypotenuse Syntax hypot(a, b) Parameters a − Length of first side (numeric value) b − Length of second side (numeric value) Return Value The hypot() function returns the length of the hypotenuse as a float ...
Read Morefmod() function in PHP
The fmod() function returns the floating-point remainder (modulo) of dividing two numbers. Unlike the modulo operator (%), fmod() handles floating-point numbers and returns a float result. Syntax fmod(dividend, divisor) Parameters dividend − The number to be divided. divisor − The number that divides the dividend. Return Value The fmod() function returns the floating-point remainder of dividend/divisor. If the divisor is zero, it returns NAN (Not a Number). Example Here's a basic example demonstrating fmod() with integers ? fmod(30, 9) = 3 ...
Read Morefloor() function in PHP
The floor() function rounds a number down to the nearest integer. It always rounds towards negative infinity, which means positive decimals are rounded down and negative decimals are rounded further away from zero. Syntax floor(num) Parameters num − The number to round down Return Value The floor() function returns the value rounded down to the nearest integer as a float. Example 1 Basic usage with positive decimal numbers − 0 0 9 Example 2 Using floor() with whole numbers ...
Read Moreexpm1() function in PHP
The expm1() function returns e raised to the power x minus 1, which is mathematically represented as ex - 1. This function is particularly useful for calculating values close to zero with higher precision than using exp(x) - 1. Syntax expm1(number) Parameters number − A floating point value representing the exponent Return Value Returns a float representing ex - 1, where e is Euler's number (approximately 2.718281828). Example 1 Basic usage of expm1() with different values − expm1(0) = 0 expm1(1) = ...
Read Moreexp() function in PHP
The exp() function in PHP returns ex, where e is the mathematical constant (approximately 2.718282) raised to the power of x. This function is commonly used in mathematical calculations involving exponential growth, logarithms, and scientific computations. Syntax exp(x) Parameters x − A numeric value representing the exponent. Can be integer, float, or any numeric expression. Return Value Returns a float value representing e raised to the power of x (ex). If the result is too large to represent as a float, the function returns INF (infinity). Basic Examples ...
Read Moredeg2rad() function in PHP
The deg2rad() function converts degree values to their radian equivalents. Radians are the standard unit of angular measurement used in many mathematical calculations, while degrees are more commonly used in everyday applications. Syntax deg2rad(number) Parameters number − The degree value to be converted to radians. Accepts integer or float values. Return Value Returns a float representing the radian equivalent of the specified degree value. Example 1: Basic Conversion Here's how to convert a single degree value to radians − 360 degrees converted ...
Read Moredechex() function in PHP
The dechex() function converts decimal numbers to their hexadecimal representation. It returns the hexadecimal string equivalent of the specified decimal value. Syntax dechex(number) Parameters number − The decimal value to be converted. Can be an integer or numeric string. Return Value Returns a string containing the hexadecimal representation of the given decimal number. Example Here's how to convert decimal numbers to hexadecimal format − f 7c6 ff 0 Working with Different Number Types The function accepts both integers and numeric strings −
Read Moredecbin() function in PHP
The decbin() function converts a decimal number to its binary representation and returns the result as a string. Syntax decbin(num) Parameters num − The decimal number to be converted to binary. Can be an integer or string representation of a number. Return Value Returns a string containing the binary representation of the given decimal number. Example 1 Converting a decimal number to binary ? 111100011001 Example 2 Converting another decimal number to binary ? ...
Read More