modf(3C)
modf, modff, modfl - split a floating-point number into integral and fractional parts (libc routines)
Showing IRIX 6.5.30 (default release). Added in IRIX 6.5.22.
NAME modf, modff, modfl - split a floating-point number into integral and fractional parts (libc routines) SYNOPSIS #include <math.h> double modf (double x, double *iptr); float modff (float x, float *iptr); long double modfl (long double x, long double *iptr); DESCRIPTION Note that the long double routine is only valid for the MIPSpro compilers. Long double functions have been renamed to be compliant with the ANSI-C standard, however to be backward compatible, they may still be called with the double precision function name prefixed with a q. (For example, qmod.) modf, modff (single-precision version) and modfl (long double-precision version) return the signed fractional part of value and store the integral part indirectly in the location pointed to by iptr. The value returned has the same sign as x. NOTES Long double operations on this system are only supported in round to nearest rounding mode (the default). The system must be in round to nearest rounding mode when calling any of the long double functions, or incorrect answers will result. Users concerned with portability to other computer systems should note that the long double and float versions of these functions were optional according to the ANSI C Programming Language Specification ISO/IEC 9899 : 1990 (E) and are no longer optional according to ISO/IEC 9899:1999(E). SEE ALSO cc(1), intro(3M). DIAGNOSTICS modf(_infinity, iptr) returns _0.0 and stores _infinity in the object pointed to by iptr. modf(NaN, iptr) stores a NaN in the object pointed to by iptr (and returns a NaN). (Similar results are true for modff and modfl.)