Commit | Line | Data |
---|---|---|
8ae6d4b2 | 1 | .\" @(#)frexp.3 6.3 (Berkeley) %G% |
10c9d29c | 2 | .\" |
4b93661e | 3 | .TH FREXP 3 "" |
10c9d29c KM |
4 | .AT 3 |
5 | .SH NAME | |
6 | frexp, ldexp, modf \- split into mantissa and exponent | |
7 | .SH SYNOPSIS | |
8 | .nf | |
9 | .B double frexp(value, eptr) | |
10 | .B double value; | |
11 | .B int *eptr; | |
12 | .PP | |
13 | .B double ldexp(value, exp) | |
14 | .B double value; | |
15 | .PP | |
16 | .B double modf(value, iptr) | |
17 | .B double value, *iptr; | |
18 | .SH DESCRIPTION | |
8ae6d4b2 KB |
19 | Every nonzero number can be written uniquely as |
20 | .if t \fIx\fP\|\(**\|2\u\fIn\fP\d, | |
21 | .if n \fIx\fP * 2^\fIn\fP, | |
22 | where the ``mantissa'' (fraction) \fIx\fP is in the range 0.5 <= |x| < 1.0, | |
23 | and the ``exponent'' \fIn\fP is an integer. \fIFrexp\fP returns the | |
24 | mantissa of a double \fIvalue\fP, and stores the exponent indirectly in | |
25 | the location pointed to by \fIeptr\fP. If \fIvalue\fP is 0, both results | |
26 | returned by \fIfrexp\fP are 0. | |
10c9d29c | 27 | .PP |
8ae6d4b2 | 28 | \fILdexp\fP returns the quantity |
a1f8195e | 29 | .if t \fIvalue\|\(**\|2\u\fIexp\fP\d. |
8ae6d4b2 | 30 | .if n \fIvalue\fP * 2^\fIexp\fP. |
10c9d29c | 31 | .PP |
8ae6d4b2 KB |
32 | \fIModf\fP returns the signed fractional part of \fIvalue\fP |
33 | and stores the integer part indirectly in the location pointed | |
34 | to by \fIiptr\fP. | |
35 | .SH DIAGNOSTICS | |
36 | If \fIldexp\fP would cause overflow, \fBHUGE\fP is returned | |
37 | and \fIerrno\fP is set to \fBERANGE\fP. |