xref: /openbsd/lib/libm/man/logb.3 (revision 5af055cd)
1.\"	$OpenBSD: logb.3,v 1.9 2013/06/05 03:40:26 tedu Exp $
2.\" Copyright (c) 1985, 1991 Regents of the University of California.
3.\" All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright
9.\"    notice, this list of conditions and the following disclaimer.
10.\" 2. Redistributions in binary form must reproduce the above copyright
11.\"    notice, this list of conditions and the following disclaimer in the
12.\"    documentation and/or other materials provided with the distribution.
13.\" 3. Neither the name of the University nor the names of its contributors
14.\"    may be used to endorse or promote products derived from this software
15.\"    without specific prior written permission.
16.\"
17.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27.\" SUCH DAMAGE.
28.\"
29.\"     from: @(#)ieee.3	6.4 (Berkeley) 5/6/91
30.\"
31.Dd $Mdocdate: June 5 2013 $
32.Dt LOGB 3
33.Os
34.Sh NAME
35.Nm logb ,
36.Nm logbf ,
37.Nm logbl ,
38.Nm scalb ,
39.Nm scalbf ,
40.Nm scalbl ,
41.Nm significand ,
42.Nm significandf
43.Nd IEEE test functions
44.Sh SYNOPSIS
45.In math.h
46.Ft double
47.Fn logb "double x"
48.Ft float
49.Fn logbf "float x"
50.Ft long double
51.Fn logbl "long double x"
52.Ft double
53.Fn scalb "double x" "double n"
54.Ft float
55.Fn scalbf "float x" "float n"
56.Ft long double
57.Fn scalbl "long double x" "long double n"
58.Ft double
59.Fn significand "double x"
60.Ft float
61.Fn significandf "float x"
62.Sh DESCRIPTION
63These functions allow users to test conformance to
64.St -ieee754 .
65Their use is not otherwise recommended.
66.Pp
67.Fn logb x
68returns
69.Fa x Ns 's exponent
70.Fa n ,
71a signed integer converted to double\-precision floating\-point.
72.Fn logb \*(Pm\*(If
73= +\*(If;
74.Fn logb 0
75= -\*(If with a division by zero exception.
76.Fn logbf
77is the single precision form of
78.Fn logb .
79.Fn logbl
80is the extended precision form of
81.Fn logb .
82.Pp
83.Fn scalb x n
84returns
85.Fa x Ns \(**(2** Ns Fa n )
86computed by exponent manipulation.
87.Fn scalbf
88is the single precision form of
89.Fn scalb .
90.Fn scalbl
91is the extended precision form of
92.Fn scalb .
93.Pp
94.Fn significand x
95returns
96.Fa sig ,
97where
98.Fa x
99:=
100.Fa sig No \(** 2** Ns Fa n
101with 1 \(<=
102.Fa sig
103< 2.
104.Fn significand x
105is not defined when
106.Fa x
107is 0, \*(Pm\*(If, or \*(Na.
108.Fn significandf
109is the single precision for of
110.Fn significand .
111.Sh SEE ALSO
112.Xr ilogb 3 ,
113.Xr scalbn 3
114.Sh STANDARDS
115.St -ieee754
116