1*9f1be2b6Stb.\" $OpenBSD: logb.3,v 1.10 2016/04/26 19:49:22 tb Exp $ 20f9b7468Sjason.\" Copyright (c) 1985, 1991 Regents of the University of California. 30f9b7468Sjason.\" All rights reserved. 40f9b7468Sjason.\" 50f9b7468Sjason.\" Redistribution and use in source and binary forms, with or without 60f9b7468Sjason.\" modification, are permitted provided that the following conditions 70f9b7468Sjason.\" are met: 80f9b7468Sjason.\" 1. Redistributions of source code must retain the above copyright 90f9b7468Sjason.\" notice, this list of conditions and the following disclaimer. 100f9b7468Sjason.\" 2. Redistributions in binary form must reproduce the above copyright 110f9b7468Sjason.\" notice, this list of conditions and the following disclaimer in the 120f9b7468Sjason.\" documentation and/or other materials provided with the distribution. 136580fee3Smillert.\" 3. Neither the name of the University nor the names of its contributors 140f9b7468Sjason.\" may be used to endorse or promote products derived from this software 150f9b7468Sjason.\" without specific prior written permission. 160f9b7468Sjason.\" 170f9b7468Sjason.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 180f9b7468Sjason.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 190f9b7468Sjason.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 200f9b7468Sjason.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 210f9b7468Sjason.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 220f9b7468Sjason.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 230f9b7468Sjason.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 240f9b7468Sjason.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 250f9b7468Sjason.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 260f9b7468Sjason.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 270f9b7468Sjason.\" SUCH DAMAGE. 280f9b7468Sjason.\" 290f9b7468Sjason.\" from: @(#)ieee.3 6.4 (Berkeley) 5/6/91 300f9b7468Sjason.\" 31*9f1be2b6Stb.Dd $Mdocdate: April 26 2016 $ 320a566153Smartynas.Dt LOGB 3 330f9b7468Sjason.Os 340f9b7468Sjason.Sh NAME 350f9b7468Sjason.Nm logb , 360f9b7468Sjason.Nm logbf , 37854ac34eSmartynas.Nm logbl , 380f9b7468Sjason.Nm scalb , 390f9b7468Sjason.Nm scalbf , 407ac6a943Smartynas.Nm scalbl , 410f9b7468Sjason.Nm significand , 420f9b7468Sjason.Nm significandf 430f9b7468Sjason.Nd IEEE test functions 440f9b7468Sjason.Sh SYNOPSIS 4586f9d4cdStedu.In math.h 460f9b7468Sjason.Ft double 470f9b7468Sjason.Fn logb "double x" 480f9b7468Sjason.Ft float 490f9b7468Sjason.Fn logbf "float x" 50854ac34eSmartynas.Ft long double 51854ac34eSmartynas.Fn logbl "long double x" 520f9b7468Sjason.Ft double 530f9b7468Sjason.Fn scalb "double x" "double n" 540f9b7468Sjason.Ft float 550f9b7468Sjason.Fn scalbf "float x" "float n" 567ac6a943Smartynas.Ft long double 577ac6a943Smartynas.Fn scalbl "long double x" "long double n" 580f9b7468Sjason.Ft double 590f9b7468Sjason.Fn significand "double x" 600f9b7468Sjason.Ft float 610f9b7468Sjason.Fn significandf "float x" 620f9b7468Sjason.Sh DESCRIPTION 630f9b7468SjasonThese functions allow users to test conformance to 640f9b7468Sjason.St -ieee754 . 650f9b7468SjasonTheir use is not otherwise recommended. 660f9b7468Sjason.Pp 670f9b7468Sjason.Fn logb x 680f9b7468Sjasonreturns 690f9b7468Sjason.Fa x Ns 's exponent 700f9b7468Sjason.Fa n , 710f9b7468Sjasona signed integer converted to double\-precision floating\-point. 72*9f1be2b6Stb.Fn logb \(+-infinity 73*9f1be2b6Stb= +infinity; 740f9b7468Sjason.Fn logb 0 75*9f1be2b6Stb= -infinity with a division by zero exception. 760f9b7468Sjason.Fn logbf 770f9b7468Sjasonis the single precision form of 780f9b7468Sjason.Fn logb . 79854ac34eSmartynas.Fn logbl 80854ac34eSmartynasis the extended precision form of 81854ac34eSmartynas.Fn logb . 820f9b7468Sjason.Pp 830f9b7468Sjason.Fn scalb x n 840f9b7468Sjasonreturns 85*9f1be2b6Stb.Fa x Ns *(2** Ns Fa n ) 860f9b7468Sjasoncomputed by exponent manipulation. 870f9b7468Sjason.Fn scalbf 880f9b7468Sjasonis the single precision form of 890f9b7468Sjason.Fn scalb . 907ac6a943Smartynas.Fn scalbl 917ac6a943Smartynasis the extended precision form of 927ac6a943Smartynas.Fn scalb . 930f9b7468Sjason.Pp 940f9b7468Sjason.Fn significand x 950f9b7468Sjasonreturns 960f9b7468Sjason.Fa sig , 970f9b7468Sjasonwhere 980f9b7468Sjason.Fa x 990f9b7468Sjason:= 100*9f1be2b6Stb.Fa sig No * 2** Ns Fa n 1010f9b7468Sjasonwith 1 \(<= 1020f9b7468Sjason.Fa sig 1030f9b7468Sjason< 2. 1040f9b7468Sjason.Fn significand x 1050f9b7468Sjasonis not defined when 1060f9b7468Sjason.Fa x 107*9f1be2b6Stbis 0, \(+-infinity, or NaN. 1080f9b7468Sjason.Fn significandf 1090f9b7468Sjasonis the single precision for of 1100f9b7468Sjason.Fn significand . 1110f9b7468Sjason.Sh SEE ALSO 112*9f1be2b6Stb.Xr fpclassify 3 , 113287d7838Smartynas.Xr ilogb 3 , 114287d7838Smartynas.Xr scalbn 3 1150f9b7468Sjason.Sh STANDARDS 1160f9b7468Sjason.St -ieee754 117