modff


Divide floating-point number into integer and decimal

[Classification]

Mathematical library

[Syntax]

#include <mathf.h>

float modff(float val, float *ipart);

[Return value]

Returns a decimal part. The sign of the result is the same as the sign of val.

[Description]

This function divides val of float type into integer and decimal parts, and stores the integer part in *ipart. Rounding is not performed. It is guaranteed that the sum of the integer part and decimal part accurately coincides with val. For example, where realpart = modff (val, &intpart), "realpart + intpartt" coincides with val.