modff(3C)




NAME

     modf, modff - decompose floating-point number


SYNOPSIS

     #include <math.h>

     double modf(double x, double *iptr);

     float modff(float x, float *iptr);


DESCRIPTION

     The modf() and modff() functions break the argument  x  into
     integral  and  fractional  parts, each of which has the same
     sign as  the  argument.   The  modf()  function  stores  the
     integral  part as a double in the object pointed to by iptr.
     The modff() function stores the integral part as a float  in
     the object pointed to by iptr.


RETURN VALUES

     Upon successful completion, modf() and  modff()  return  the
     signed fractional part of x.

     If x is NaN, NaN is returned and *iptr is set to NaN.

     If the correct value would cause underflow  to  0.0,  modf()
     returns 0 and errno may be set to ERANGE.


ERRORS

     The modf() function may fail if:

     ERANGE
           The result underflows.


USAGE

     An application wishing to check for error situations  should
     set  errno  to 0 before calling modf(). If errno is non-zero
     on return,  or  the  return  value  is  NaN,  an  error  has
     occurred.


ATTRIBUTES

     See attributes(5) for descriptions of the  following  attri-
     butes:

     ____________________________________________________________
    |       ATTRIBUTE TYPE        |       ATTRIBUTE VALUE       |
    |_____________________________|_____________________________|
    | MT-Level                    | MT-Safe                     |
    |_____________________________|_____________________________|


SEE ALSO


     frexp(3C), isnan(3M), ldexp(3C), attributes(5)


Man(1) output converted with man2html