Sun Microsystems, Inc.
spacerspacer
spacer   www.sun.com docs.sun.com | | |  
spacer
black dot
   
A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z
    
 
Standard C Library Functionsmodf(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 attributes:

ATTRIBUTE TYPEATTRIBUTE VALUE
MT-LevelMT-Safe

SEE ALSO

 

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


SunOS 5.9Go To TopLast Changed 29 Dec 1996

 
      
      
Copyright 2002 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.