Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > F

frexp(3M)

HP-UX 11i Version 3: February 2007
» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index

NAME

frexp(), frexpf(), frexpl(), frexpw(), frexpq() — extract mantissa and exponent from floating-point number

SYNOPSIS

#include <math.h>

double frexp(double value, int *exp);

HP Integrity Server Only

float frexpf(float value, int *exp);

long double frexpl(long double value, int *exp);

extended frexpw(extended value, int *exp);

quad frexpq(quad value, 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.

Integrity Server Only

frexpf() is a float version of frexp(); it takes a float first argument and returns a float result.

frexpl() is a long double version of frexp(); it takes a long double first argument and returns a long double result.

frexpw() is an extended version of frexp(); it takes an extended first argument and returns an extended result. frexpq() is equivalent to frexpl() on HP-UX systems.

USAGE

To use (for Integrity servers) frexpf(), compile either with the default -Ae option or with the -Aa option.

To use (for Integrity servers) frexpl(), frexpw(), or frexpq(), compile either with the default -Ae option or with the -Aa and -D_HPUX_SOURCE options.

To use (for Integrity servers) frexpw() or frexpq(), compile also with the -fpwidetypes option.

To use any of these functions, make sure your program includes <math.h>, and link in the math library by specifying -lm on the compiler or linker command line. For more information, see the HP-UX floating-point guide for HP Integrity servers at the following site: http://www.hp.com/go/fp.

RETURN VALUE

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

If value is zero, returns value and stores zero in the object pointed to by exp.

If value is NaN, frexp() returns NaN, and the value of *exp is unspecified.

If value is ±INFINITY, frexp() returns value, and the value of *exp is unspecified.

These functions raise no exceptions.

ERRORS

No errors are defined.

STANDARDS CONFORMANCE

frexp() : SVID3, XPG4.2, ANSI C, ISO/IEC C99 (including Annex F, ``IEC 60559 floating-point arithmetic'')

frexpf(), frexpl() : ISO/IEC C99 (including Annex F, ``IEC 60559 floating-point arithmetic'')

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.