·  Home
+   man pages
 -> Linux -> FreeBSD -> OpenBSD -> NetBSD -> Tru64 Unix -> HP-UX 11i -> IRIX
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

man pages->Tru64 Unix man pages -> frexp (3)
 Title
 Content
 Arch
 Section All Sections 1 - General Commands 2 - System Calls 3 - Subroutines 4 - Special Files 5 - File Formats 6 - Games 7 - Macros and Conventions 8 - Maintenance Commands 9 - Kernel Interface n - New Commands

## frexp(3)

```
```

### NAME[Toc][Back]

```       frexp, ldexp, logb, scalb - Manipulate floating-point numbers

```

### SYNOPSIS[Toc][Back]

```       #include <math.h>

double frexp(
double x,
int *n ); float frexpf(
float x,
int *n ); long double frexpl(
long double x,
int *n ); double ldexp(
double y,
int n ); float ldexpf(
float y,
int n ); long double ldexpl(
long double y,
int n ); double logb(
double x ); float logbf(
float x ); long double logbl(
long double x ); double scalb(
double x,
double n ); float scalbf(
float x,
float n ); long double scalbl(
long double x,
long double n );
```

### LIBRARY[Toc][Back]

```       Math Library (libm)
```

### STANDARDS[Toc][Back]

```       Interfaces documented on this reference  page  conform  to
industry standards as follows:

frexp():  XPG4

ldexp():  XPG4

logb():  XPG4-UNIX

scalb():  XPG4-UNIX

about industry standards and associated tags.
```

### DESCRIPTION[Toc][Back]

```       Every nonzero number can be written uniquely as  the  normalized
mantissa (fraction) z times 2 raised to the power
p, where the absolute value of z is  in  the  range  [0.5,
1.0), and the exponent p, is an integer.

The  frexp(),  frexpf(),  and  frexpl()  functions break a
floating-point number into a normalized  fraction  and  an
integral  power  of  2. The functions store the integer in
the int object pointed to by the n  parameter  and  return
the fraction part.

The  ldexp(),  ldexpf(), and ldexpl() functions multiply a
floating-point number, y, by an integral power of 2.

The logb(), logbf(), and logbl() functions return a signed
integer  converted  to double-precision floating-point and
so chosen that 1 <= |x|/2**n < 2 unless x =  0  or  |x|  =
infinity  or x lies between 0 and the Underflow Threshold.

IEEE 754 defines logb(+infinity) = +infinity and logb(0) =
-infinity.  The  latter is required to signal Division-byZero.

The scalb(), scalbf(), and scalbl() functions are  defined
as x*(2**n) for integer n.

The   following   table  describes  function  behavior  in
response to exceptional arguments:

--------------------------------------------------------------------------
Function                        Exceptional Argument     Routine Behavior
--------------------------------------------------------------------------
frexp(), frexpf(), frexpl()     |x| = infinity           Invalid argument
logb(), logbf(), logbl()        |x| = infinity           Invalid argument
scalb(), scalbf(), scalbl()     x*(2**n) > max_float     Overflow
scalb(), scalbf(), scalbl()     x*(2**n) < min_float     Underflow
ldexp(), ldexpf(), ldexpl()     x*(2**n) > max_float     Overflow
ldexp(), ldexpf(), ldexpl()     x*(2**n) < min_float     Underflow
--------------------------------------------------------------------------

The following table lists boundary values  used  by  these
functions:

--------------------------------------------------------------------
Value Name   Data Type   Hexadecimal Value   Decimal Value
--------------------------------------------------------------------
max_float    S_FLOAT     7F7FFFFF            3.402823e38
T_FLOAT     7FEFFFFFFFFFFFFF    1.797693134862316e308
min_float    S_FLOAT     00000001            1.4012985e-45
T_FLOAT     0000000000000001    4.940656458412465e-324
--------------------------------------------------------------------

frexp(3)
```
[ Back ]
Similar pages
 Name OS Title frexp IRIX manipulate parts of floating-point numbers (libc routines) isgreaterequal FreeBSD compare two floating-point numbers isgreater FreeBSD compare two floating-point numbers isless FreeBSD compare two floating-point numbers islessgreater FreeBSD compare two floating-point numbers isunordered FreeBSD compare two floating-point numbers islessequal FreeBSD compare two floating-point numbers fpgetmask IRIX floating-point units glcgetf IRIX return value of a specified floating point variable fpgetround FreeBSD IEEE floating point interface