xref: /original-bsd/lib/libc/gen/frexp.3 (revision 08eb28af)
1.\" Copyright (c) 1991 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)frexp.3	6.4 (Berkeley) 04/19/91
7.\"
8.Dd
9.Dt FREXP 3
10.Os
11.Sh NAME
12.Nm frexp
13.Nd convert floating-point number to fractional and integral components
14.Sh SYNOPSIS
15.Fd #include <math.h>
16.Ft double
17.Fn frexp "double value" "int *exp"
18.Sh DESCRIPTION
19The
20.Fn frexp
21function breaks a floating-point number into a normalized
22fraction and an integral power of 2.
23It stores the integer in the
24.Em int
25object pointed to by
26.Fa exp .
27.Sh RETURN VALUES
28The
29.Fn frexp
30function returns the value
31.Em x ,
32such that
33.Em x
34is a
35.Em double
36with magnitude in the interval
37.Bq 1/2 , 1
38or zero, and
39.Fa value
40equals
41.Em x
42times 2 raised to the power
43.Fa *exp .
44If
45.Fa value
46is zero, both parts of the result are zero.
47.Sh SEE ALSO
48.Xr ldexp 3 ,
49.Xr modf 3 ,
50.Xr math 3
51.Sh STANDARDS
52The
53.Fn frexp
54function conforms to
55.St -ansiC .
56