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