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 > E

exp2(3M)

HP-UX 11i Version 3: February 2007
» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index

NAME

exp2(), exp2f(), exp2l(), exp2w(), exp2q() — base-2 exponential functions

SYNOPSIS

#include <math.h>

double exp2(double x);

HP Integrity Server Only

float exp2f(float x);

long double exp2l(long double x);

extended exp2w(extended x);

quad exp2q(quad x);

DESCRIPTION

exp2() returns 2x.

Integrity System Only

exp2f() is a float version of exp2(); it takes a float argument and returns a float result.

exp2l() is a long double version of exp2(); it takes a long double argument and returns a long double result.

exp2w() is an extended version of exp2(); it takes an extended argument and returns an extended result.

exp2q() is equivalent to exp2l() on HP-UX systems.

USAGE

To use these functions, compile either with the default -Ae option or with the -Aa and -D_HPUX_SOURCE options.

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

To use 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

exp2(±0) returns 1.

If x is +INFINITY, exp2() returns +INFINITY.

If x is -INFINITY, exp2() returns zero.

If x is NaN, exp2() returns NaN.

exp2() returns infinity (equal to HUGE_VAL) in lieu of a value whose magnitude is too large, and raises the overflow and inexact exceptions.

exp2() raises the underflow and inexact exceptions whenever a result is tiny (essentially denormal or zero) and thereby suffers loss of accuracy, and may raise those exceptions if the result is merely tiny.

exp2() raises the inexact exception whenever a rounded result does not equal the mathematical result.

ERRORS

Integrity Server Only

If the correct value would overflow, exp2() sets errno to [ERANGE].

HP-UX libm functions on Integrity servers do not set errno by default. For errno setting, compile with the +Olibmerrno option.

STANDARDS CONFORMANCE

exp2(), exp2f(), exp2l() : 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.