The fmodl()
function in C performs the division operation of two input arguments. In mathematical notation, fmodl()
performs the function of . The fmodl()
function in C is defined in the <math.h>
header file.
To use the fmodl()
function, you must include the <math.h>
library at the beginning of your code as shown below:
#include<math.h>
The fmodl()
function is defined as below in the <math.h>
header file:
long double fmodl( long double x, long double y );
The fmodl()
function takes two arguments ( and ) of type long double
as input.
The fmodl()
function returns the remainder if divides . The return value is of type long double
.
Different values of and can result in varying results and errors:
Not a Number (NaN)
.NaN
.NaN
, the return value will also be NaN
.Below is an example of how you can use fmodl()
:
#include<stdio.h>#include<math.h>int main() {printf("4.2/2 = %Lf\n", fmodl(4.2,2));return 0;}
The fmodl()
function has been given the arguments such that and . The function divides and returns the result of this division.
Free Resources