-

Difference between revisions of "Functions HI-TECH C FREXP"

From HI-TECH C for CP/M Fan WIKI(EN)
Jump to: navigation, search
(Created page with "<strong>FREXP, LDEXP<strong> ==SYNOPSIS== #include <math.h> double frexp(double f, int * p) double ldexp(double f, int i) ==DESCRIPTION== <strong>Frexp</stron...")
 
 
Line 1: Line 1:
<strong>FREXP, LDEXP<strong>
+
<strong>FREXP, LDEXP</strong>
 
==SYNOPSIS==
 
==SYNOPSIS==
  

Latest revision as of 19:58, 31 July 2017

FREXP, LDEXP

SYNOPSIS

#include  <math.h>

double    frexp(double f, int * p)

double    ldexp(double f, int i)


DESCRIPTION

Frexp() breaks a floating point number into a normalized fraction and an integral power of 2. The integer is stored into the int object pointed to by p. Its return value x is in the interval [0.5, 1.0) or zero, and f equals x times 2 raised to the power stored in

  • p. If f is zero, both parts of the result are zero.

Ldexp() performs the reverse operation; the integer i is added to the exponent of the floating point f and the resultant value returned.