PHP fdiv() Function Last Updated : 28 Apr, 2025 Summarize Comments Improve Suggest changes Share Like Article Like Report The fdiv() is an inbuilt PHP function that returns the result of a division of 2 numbers(in accordance with IEEE 754). The NaN will never == or === for any value while doing the comparison, even including itself. Syntax: fdiv(float $num1, float $num2): floatParameters: This function accepts 2 parameters: num1: This parameter indicates the dividend or numerator.num2: This parameter indicates the divisor numberReturn Value: This function returns floating point values by dividing num1 / num2. The INF, -INF, or NAN will be returned if the second number is zero. Example 1:The following example demonstrates the fdiv() function. PHP <?php var_dump(fdiv(5.7,1.3)); var_dump(fdiv(3,2)) ; ?> Output: float(4.384615384615385) float(1.5) Example 2: The following example demonstrates the fdiv() function. PHP <?php var_dump(fdiv(10,2)); var_dump(fdiv(4,2)) ; ?> Output: float(5) float(2) Reference: https://www.php.net/manual/en/function.fdiv.php Comment More infoAdvertise with us Next Article PHP | is_dir( ) Function N neeraj3304 Follow Improve Article Tags : PHP PHP-math PHP-function Similar Reads PHP | bcdiv() Function The bcdiv() function in PHP is an inbuilt function and is used to divide two arbitrary precision numbers. This function accepts two arbitrary precision numbers as strings and returns the division of the two numbers after scaling the result to a specified precision. Syntax: string bcdiv ( $num_str1, 2 min read PHP | dir() Function The dir() function in PHP is an inbuilt function which is used to return an instance of the Directory class. The dir() function is used to read a directory, which includes the following: The given directory is opened. The two properties handle and path of dir() are available. Both handle and path pr 2 min read PHP fmod() Function fmod stands for Floating Modulo. Modulo calculates the remainder of a division which is generally noted with the '%' symbol. However, the general modulo expression expects both the divisor and dividend to be of integer type, this is a great limitation to such an important operation. In PHP the fmod( 2 min read PHP chdir() Function PHP chdir() function is used to change the current directory to new directory path. It takes only a single argument as new directory path. Syntaxbool chdir(string $new_directory_path)ParametersThis function accepts one parameter, which is mandatory. Return ValueIt returns a boolean operator as retur 2 min read PHP | is_dir( ) Function The is_dir() function in PHP used to check whether the specified file is a directory or not. The name of the file is sent as a parameter to the is_dir() function and it returns True if the file is a directory else it returns False. Syntax: is_dir($file) Parameters Used: The is_dir() function in PHP 1 min read PHP | gmp_div_q() Function The gmp_div_q() is an inbuilt function in PHP which is used to perform division of GMP numbers(GNU Multiple Precision : For large numbers). Syntax: gmp_div_q($num1, $num2) Parameters: This function accepts GMP numbers, $num1 and $num2 as mandatory parameters as shown in the above syntax. These param 2 min read Like