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