Borland C++ reference

ldexp, ldexpl

raw OCR

Calculates x x 2^^p.

Defined in header <math.h>

Syntax

#include <math.h>
double ldexp(double  x, int exp);
long double IdexpKlong  double x, int exp);

Portability

DOSUNIXWindowsANSI CC++ only
Idexp ■■■■
Idexpl ■■

Remarks

Idexp calculates the double value x x I'^^P. lexpl is the long double version; it takes a long double argument for x and returns a long double result.

Return value

On success, Idexp (or Idexpl) returns the value it calculated, x x 2''^^.

Error handling for these routines can be modified through the functions matherr and _matherrl.

See also

Example

*include <stdio.h>
#include <math.h>

int main(void)
{
   double value, x = 2;

   /* Idexp raises 2 by a power  of 3 then multiplies the result by 2 */
   value = Idexp (x,3);
   printfC'The Idexp value  is: %lf\n", value);
   return 0;

Differences from modern implementations

Nothing recorded yet.

Modern references

These are search links, not yet checked by hand.

Extraction notes

  • heading `Idexp, Idexpi` read as `ldexp, ldexpl`