std::modf() is a function in the C++ <cmath> library that splits a floating-point number into its integer and fractional parts.
Syntax:
cpp
Copy
Edit
double modf(double x, double* intPart);
float modf(float x, float* intPart);
long double modf(long double x, long double* intPart);
x → The floating-point number to be split.
intPart → A pointer where the integer part of x will be stored.
Returns → The fractional part of x.