Pointer to a `double` where the integer part of `x` will be stored.
Read more about parameters of modf in parameters section
The modffunction in C language Breaks a floating-point number into integer and fractional parts.
The modf function breaks down the floating-point number x into integer and fractional parts. It stores the integer part in the object pointed to by intpart, and returns the fractional part. Both parts have the same sign as x.
The modffunction takes 2
parameters:
•
double `x`: The input floating-point value to be split into its integer and fractional parts.
•
double * `iptr`: Pointer to a `double` where the integer part of `x` will be stored.
Splits the given floating-point value `x` into its integer and fractional parts. The integer part is stored in the location pointed to by `iptr`, and the fractional part is returned as the function result. Both parts have the same sign as the input value `x`.
The modf function return value :
Returns the fractional part of x as a double
Output
This example demonstrates how modf breaks down a floating-point number into its integer and fractional parts.