File:  [CSRG BSD Unix] / 43BSDReno / lib / libc / gen / frexp.3
Revision 1.1: download - view: text, annotated - select for diffs
Tue Apr 24 16:12:55 2018 UTC (8 years, 1 month ago) by root
CVS tags: MAIN, HEAD
Initial revision

.\"	@(#)frexp.3	6.3 (Berkeley) 4/13/87
.\"
.TH FREXP 3 "April 13, 1987"
.AT 3
.SH NAME
frexp, ldexp, modf \- split into mantissa and exponent
.SH SYNOPSIS
.nf
.B double frexp(value, eptr)
.B double value;
.B int *eptr;
.PP
.B double ldexp(value, exp)
.B double value;
.PP
.B double modf(value, iptr)
.B double value, *iptr;
.SH DESCRIPTION
Every nonzero number can be written uniquely as
.if t \fIx\fP\|\(**\|2\u\fIn\fP\d,
.if n \fIx\fP * 2^\fIn\fP,
where the ``mantissa'' (fraction) \fIx\fP is in the range 0.5 <= |x| < 1.0,
and the ``exponent'' \fIn\fP is an integer.  \fIFrexp\fP returns the
mantissa of a double \fIvalue\fP, and stores the exponent indirectly in
the location pointed to by \fIeptr\fP.  If \fIvalue\fP is 0, both results
returned by \fIfrexp\fP are 0.
.PP
\fILdexp\fP returns the quantity
.if t \fIvalue\|\(**\|2\u\fIexp\fP\d.
.if n \fIvalue\fP * 2^\fIexp\fP.
.PP
\fIModf\fP returns the signed fractional part of \fIvalue\fP
and stores the integer part indirectly in the location pointed
to by \fIiptr\fP.
.SH DIAGNOSTICS
If \fIldexp\fP would cause overflow, \fBHUGE\fP is returned
and \fIerrno\fP is set to \fBERANGE\fP.

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.