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 Functionsfrexp(3C)


NAME

 frexp - extract mantissa and exponent from double precision number

SYNOPSIS

 
#include <math.h>
double frexp(double num, int *exp);

DESCRIPTION

 

The frexp() function breaks a floating-point number into a normalized fraction and an integral power of 2. It stores the integer exponent in the int object pointed to by exp.

RETURN VALUES

 

The frexp() function returns the value x, such that x is a double with magnitude in the interval [½, 1) or 0, and num equals x times 2 raised to the power *exp.

If num is 0, both parts of the result are 0.

If num is NaN, NaN is returned and the value of *exp is unspecified.

If num is +-Inf, num is returned and the value of *exp is unspecified.

USAGE

 

An application wishing to check for error situations should set errno to 0 before calling frexp(). 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

 

isnan(3M), ldexp(3C), modf(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.