xref: /dflybsd-src/contrib/openbsd_libm/man/logb.3 (revision 90572312ac515bcaaedfa1f84612254fae2de296)
105a0b428SJohn Marino.\"	$OpenBSD: logb.3,v 1.9 2013/06/05 03:40:26 tedu Exp $
205a0b428SJohn Marino.\" Copyright (c) 1985, 1991 Regents of the University of California.
305a0b428SJohn Marino.\" All rights reserved.
405a0b428SJohn Marino.\"
505a0b428SJohn Marino.\" Redistribution and use in source and binary forms, with or without
605a0b428SJohn Marino.\" modification, are permitted provided that the following conditions
705a0b428SJohn Marino.\" are met:
805a0b428SJohn Marino.\" 1. Redistributions of source code must retain the above copyright
905a0b428SJohn Marino.\"    notice, this list of conditions and the following disclaimer.
1005a0b428SJohn Marino.\" 2. Redistributions in binary form must reproduce the above copyright
1105a0b428SJohn Marino.\"    notice, this list of conditions and the following disclaimer in the
1205a0b428SJohn Marino.\"    documentation and/or other materials provided with the distribution.
1305a0b428SJohn Marino.\" 3. Neither the name of the University nor the names of its contributors
1405a0b428SJohn Marino.\"    may be used to endorse or promote products derived from this software
1505a0b428SJohn Marino.\"    without specific prior written permission.
1605a0b428SJohn Marino.\"
1705a0b428SJohn Marino.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
1805a0b428SJohn Marino.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1905a0b428SJohn Marino.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2005a0b428SJohn Marino.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2105a0b428SJohn Marino.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2205a0b428SJohn Marino.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2305a0b428SJohn Marino.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2405a0b428SJohn Marino.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2505a0b428SJohn Marino.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2605a0b428SJohn Marino.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2705a0b428SJohn Marino.\" SUCH DAMAGE.
2805a0b428SJohn Marino.\"
2905a0b428SJohn Marino.\"     from: @(#)ieee.3	6.4 (Berkeley) 5/6/91
3005a0b428SJohn Marino.\"
3105a0b428SJohn Marino.Dd $Mdocdate: June 5 2013 $
3205a0b428SJohn Marino.Dt LOGB 3
3305a0b428SJohn Marino.Os
3405a0b428SJohn Marino.Sh NAME
3505a0b428SJohn Marino.Nm logb ,
3605a0b428SJohn Marino.Nm logbf ,
3705a0b428SJohn Marino.Nm logbl ,
3805a0b428SJohn Marino.Nm scalb ,
3905a0b428SJohn Marino.Nm scalbf ,
40*90572312SSascha Wildner.\".Nm scalbl ,
4105a0b428SJohn Marino.Nm significand ,
4205a0b428SJohn Marino.Nm significandf
4305a0b428SJohn Marino.Nd IEEE test functions
4405a0b428SJohn Marino.Sh SYNOPSIS
4505a0b428SJohn Marino.In math.h
4605a0b428SJohn Marino.Ft double
4705a0b428SJohn Marino.Fn logb "double x"
4805a0b428SJohn Marino.Ft float
4905a0b428SJohn Marino.Fn logbf "float x"
5005a0b428SJohn Marino.Ft long double
5105a0b428SJohn Marino.Fn logbl "long double x"
5205a0b428SJohn Marino.Ft double
5305a0b428SJohn Marino.Fn scalb "double x" "double n"
5405a0b428SJohn Marino.Ft float
5505a0b428SJohn Marino.Fn scalbf "float x" "float n"
56*90572312SSascha Wildner.\".Ft long double
57*90572312SSascha Wildner.\".Fn scalbl "long double x" "long double n"
5805a0b428SJohn Marino.Ft double
5905a0b428SJohn Marino.Fn significand "double x"
6005a0b428SJohn Marino.Ft float
6105a0b428SJohn Marino.Fn significandf "float x"
6205a0b428SJohn Marino.Sh DESCRIPTION
6305a0b428SJohn MarinoThese functions allow users to test conformance to
6405a0b428SJohn Marino.St -ieee754 .
6505a0b428SJohn MarinoTheir use is not otherwise recommended.
6605a0b428SJohn Marino.Pp
6705a0b428SJohn Marino.Fn logb x
6805a0b428SJohn Marinoreturns
6905a0b428SJohn Marino.Fa x Ns 's exponent
7005a0b428SJohn Marino.Fa n ,
7105a0b428SJohn Marinoa signed integer converted to double\-precision floating\-point.
7205a0b428SJohn Marino.Fn logb \*(Pm\*(If
7305a0b428SJohn Marino= +\*(If;
7405a0b428SJohn Marino.Fn logb 0
7505a0b428SJohn Marino= -\*(If with a division by zero exception.
7605a0b428SJohn Marino.Fn logbf
7705a0b428SJohn Marinois the single precision form of
7805a0b428SJohn Marino.Fn logb .
7905a0b428SJohn Marino.Fn logbl
8005a0b428SJohn Marinois the extended precision form of
8105a0b428SJohn Marino.Fn logb .
8205a0b428SJohn Marino.Pp
8305a0b428SJohn Marino.Fn scalb x n
8405a0b428SJohn Marinoreturns
8505a0b428SJohn Marino.Fa x Ns \(**(2** Ns Fa n )
8605a0b428SJohn Marinocomputed by exponent manipulation.
8705a0b428SJohn Marino.Fn scalbf
8805a0b428SJohn Marinois the single precision form of
8905a0b428SJohn Marino.Fn scalb .
90*90572312SSascha Wildner.\".Fn scalbl
91*90572312SSascha Wildner.\"is the extended precision form of
92*90572312SSascha Wildner.\".Fn scalb .
9305a0b428SJohn Marino.Pp
9405a0b428SJohn Marino.Fn significand x
9505a0b428SJohn Marinoreturns
9605a0b428SJohn Marino.Fa sig ,
9705a0b428SJohn Marinowhere
9805a0b428SJohn Marino.Fa x
9905a0b428SJohn Marino:=
10005a0b428SJohn Marino.Fa sig No \(** 2** Ns Fa n
10105a0b428SJohn Marinowith 1 \(<=
10205a0b428SJohn Marino.Fa sig
10305a0b428SJohn Marino< 2.
10405a0b428SJohn Marino.Fn significand x
10505a0b428SJohn Marinois not defined when
10605a0b428SJohn Marino.Fa x
10705a0b428SJohn Marinois 0, \*(Pm\*(If, or \*(Na.
10805a0b428SJohn Marino.Fn significandf
10905a0b428SJohn Marinois the single precision for of
11005a0b428SJohn Marino.Fn significand .
11105a0b428SJohn Marino.Sh SEE ALSO
11205a0b428SJohn Marino.Xr ilogb 3 ,
11305a0b428SJohn Marino.Xr scalbn 3
11405a0b428SJohn Marino.Sh STANDARDS
11505a0b428SJohn Marino.St -ieee754
116