modf()                   Split Floating Point into Mantissa and Exponent
 
 #include   <math.h>
 
 double     modf(x,intptr);
 double     x;                           Floating-point value
 double     *intptr;                     Pointer to stored integer portion
 
    modf() separates 'x' into fractional and integer parts.  '*intptr' is
    set to the integer portion, and the fractional portion is returned.
 
    Returns:    The fractional part of 'x'.  There is no error return.
 
  -------------------------------- Example ---------------------------------
 
    The following statements get the fractional and integer parts of two
    different floating-point values:
 
          #include <math.h>      /* Required for function declaration only */
 
          main()
          {
             double f, i;
 
             f = modf(69.2665, &i);    /* f = 0.2665, i = 69.0 */
             f = modf(-69.2665, &i);   /* f = -0.2665, i = -69.0 */
          }

Seealso:



This page last updated on Fri Nov 30 10:48:32 MSK 2001
Copyright © 1992-2001, Vitaly Filatov, Moscow, Russia
Webmaster