The modf()
family of functions all take a pointer parameter:
float modff( float arg, float* iptr );
double modf( double arg, double* iptr );
long double modfl( long double arg, long double* iptr );
for returning the integral part of their input arg
(the fractional part is the actual return value).
If I only need the fractional part, can I "skip" the computation of the integral part by passing NULL
?
Neither the cppreference page I liked to, nor man modff
, say anything about what happens when you pass NULL
for iptr
, while some other standard library functions take NULL as an indication of "ignore this parameter".