xref: /netbsd/lib/libm/man/ieee_test.3 (revision 56b14ee0)
1593d18fcSjtc.\" Copyright (c) 1985, 1991 Regents of the University of California.
2593d18fcSjtc.\" All rights reserved.
3593d18fcSjtc.\"
4593d18fcSjtc.\" Redistribution and use in source and binary forms, with or without
5593d18fcSjtc.\" modification, are permitted provided that the following conditions
6593d18fcSjtc.\" are met:
7593d18fcSjtc.\" 1. Redistributions of source code must retain the above copyright
8593d18fcSjtc.\"    notice, this list of conditions and the following disclaimer.
9593d18fcSjtc.\" 2. Redistributions in binary form must reproduce the above copyright
10593d18fcSjtc.\"    notice, this list of conditions and the following disclaimer in the
11593d18fcSjtc.\"    documentation and/or other materials provided with the distribution.
12eb7c1594Sagc.\" 3. Neither the name of the University nor the names of its contributors
13593d18fcSjtc.\"    may be used to endorse or promote products derived from this software
14593d18fcSjtc.\"    without specific prior written permission.
15593d18fcSjtc.\"
16593d18fcSjtc.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17593d18fcSjtc.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18593d18fcSjtc.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19593d18fcSjtc.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20593d18fcSjtc.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21593d18fcSjtc.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22593d18fcSjtc.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23593d18fcSjtc.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24593d18fcSjtc.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25593d18fcSjtc.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26593d18fcSjtc.\" SUCH DAMAGE.
27593d18fcSjtc.\"
28593d18fcSjtc.\"     from: @(#)ieee.3	6.4 (Berkeley) 5/6/91
29*56b14ee0Swiz.\"	$NetBSD: ieee_test.3,v 1.14 2017/07/03 21:32:50 wiz Exp $
30593d18fcSjtc.\"
31f73a9c72Sjoerg.Dd August 3, 2011
32593d18fcSjtc.Dt IEEE_TEST 3
33593d18fcSjtc.Os
34593d18fcSjtc.Sh NAME
35593d18fcSjtc.Nm logb ,
36f8173630Skleink.Nm logbf ,
37f73a9c72Sjoerg.Nm logbl ,
38593d18fcSjtc.Nm scalb ,
39f8173630Skleink.Nm scalbf ,
40f8173630Skleink.Nm significand ,
41f8173630Skleink.Nm significandf
42593d18fcSjtc.Nd IEEE test functions
43312aca53Sperry.Sh LIBRARY
44312aca53Sperry.Lb libm
45593d18fcSjtc.Sh SYNOPSIS
46472351e1Swiz.In math.h
47593d18fcSjtc.Ft double
48593d18fcSjtc.Fn logb "double x"
49df8b005fSjtc.Ft float
50df8b005fSjtc.Fn logbf "float x"
51f73a9c72Sjoerg.Ft long double
52f73a9c72Sjoerg.Fn logbl "long double x"
53593d18fcSjtc.Ft double
54593d18fcSjtc.Fn scalb "double x" "double n"
55df8b005fSjtc.Ft float
56df8b005fSjtc.Fn scalbf "float x" "float n"
57593d18fcSjtc.Ft double
58593d18fcSjtc.Fn significand "double x"
59df8b005fSjtc.Ft float
60f8173630Skleink.Fn significandf "float x"
61593d18fcSjtc.Sh DESCRIPTION
62593d18fcSjtcThese functions allow users to test conformance to
63593d18fcSjtc.St -ieee754 .
6473c7f7a1SabhinavTheir use is otherwise not recommended.
65593d18fcSjtc.Pp
66593d18fcSjtc.Fn logb x
67593d18fcSjtcreturns
68593d18fcSjtc.Fa x Ns 's exponent
69593d18fcSjtc.Fa n ,
70593d18fcSjtca signed integer converted to double\-precision floating\-point.
71593d18fcSjtc.Fn logb \*(Pm\*(If
72593d18fcSjtc= +\*(If;
73593d18fcSjtc.Fn logb 0
74593d18fcSjtc= -\*(If with a division by zero exception.
75593d18fcSjtc.Pp
7673c7f7a1Sabhinav.Fn scalb x n
77593d18fcSjtcreturns
78593d18fcSjtc.Fa x Ns \(**(2** Ns Fa n )
79593d18fcSjtccomputed by exponent manipulation.
80593d18fcSjtc.Pp
81593d18fcSjtc.Fn significand x
82593d18fcSjtcreturns
83593d18fcSjtc.Fa sig ,
84593d18fcSjtcwhere
85593d18fcSjtc.Fa x
86593d18fcSjtc:=
87593d18fcSjtc.Fa sig No \(** 2** Ns Fa n
88dc5571b2Srosswith 1 \*[Le]
89593d18fcSjtc.Fa sig
90*56b14ee0Swiz< 2.
91593d18fcSjtc.Fn significand x
92593d18fcSjtcis not defined when
93593d18fcSjtc.Fa x
94593d18fcSjtcis 0, \*(Pm\*(If, or \*(Na.
95593d18fcSjtc.Sh SEE ALSO
96593d18fcSjtc.Xr math 3
97593d18fcSjtc.Sh STANDARDS
98593d18fcSjtc.St -ieee754
99