xref: /original-bsd/lib/libc/gen/ldexp.3 (revision 698bcc85)
1.\" Copyright (c) 1991 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)ldexp.3	5.1 (Berkeley) 05/02/91
7.\"
8.Dd
9.Dt LDEXP 3
10.Os
11.Sh NAME
12.Nm ldexp
13.Nd mutliply floating-point number by integral power of 2
14.Sh SYNOPSIS
15.Fd #include <math.h>
16.Ft double
17.Fn ldexp "double x" "int exp"
18.Sh DESCRIPTION
19The
20.Fn ldexp
21function multiplies a floating-point number by an integral
22power of 2.
23.Sh RETURN VALUES
24The
25.Fn ldexp
26function returns the value of
27.Fa x
28times 2 raised to the power
29.Fa exp .
30.Pp
31If the resultant value would cause an overflow,
32the global variable
33.Va errno
34is set to
35.Er ERANGE
36and the value
37.Dv HUGE
38is returned.
39.Sh SEE ALSO
40.Xr frexp 3 ,
41.Xr modf 3 ,
42.Xr math 3
43.Sh STANDARDS
44The
45.Fn ldexp
46function conforms
47.St -ansiC .
48