Programming Articles

Page 1078 of 2547

hypot() function in PHP

Samual Sam
Samual Sam
Updated on 15-Mar-2026 157 Views

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 More

fmod() function in PHP

Samual Sam
Samual Sam
Updated on 15-Mar-2026 284 Views

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 More

floor() function in PHP

karthikeya Boyini
karthikeya Boyini
Updated on 15-Mar-2026 221 Views

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 More

expm1() function in PHP

Samual Sam
Samual Sam
Updated on 15-Mar-2026 128 Views

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 More

exp() function in PHP

karthikeya Boyini
karthikeya Boyini
Updated on 15-Mar-2026 138 Views

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 More

deg2rad() function in PHP

Samual Sam
Samual Sam
Updated on 15-Mar-2026 152 Views

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 More

dechex() function in PHP

Samual Sam
Samual Sam
Updated on 15-Mar-2026 167 Views

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 More

decbin() function in PHP

karthikeya Boyini
karthikeya Boyini
Updated on 15-Mar-2026 160 Views

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

cosh() function in PHP

Samual Sam
Samual Sam
Updated on 15-Mar-2026 190 Views

The cosh() function in PHP returns the hyperbolic cosine of a number. This mathematical function is useful for calculations involving exponential growth and decay, catenary curves, and engineering applications. Syntax cosh(number) Parameters number − A numeric value for which to calculate the hyperbolic cosine. The value should be in radians. Return Value Returns a floating-point number representing the hyperbolic cosine of the input value. The result is always positive since cosh(x) = cosh(-x). Examples Basic Usage Here's how to calculate the hyperbolic cosine of positive and negative ...

Read More

ceil() function in PHP

Samual Sam
Samual Sam
Updated on 15-Mar-2026 338 Views

The ceil() function rounds a number up to the nearest greater integer. This function always rounds up, regardless of the decimal value. Syntax ceil(number) Parameters number − The numeric value to round up Return Value Returns the value rounded up to the nearest integer as a float. Example 1: Basic Usage Here's how ceil() works with positive decimal numbers ? 1 1 3 Example 2: Whole Numbers When applied to whole numbers, ceil() returns the same value ? ...

Read More
Showing 10771–10780 of 25,466 articles
Advertisements