1*5175c414Swiz.\" $NetBSD: frexp.3,v 1.4 2015/09/10 12:30:08 wiz Exp $ 251086becSdrochner.\" 351086becSdrochner.\" Copyright (c) 1991, 1993 451086becSdrochner.\" The Regents of the University of California. All rights reserved. 551086becSdrochner.\" 651086becSdrochner.\" This code is derived from software contributed to Berkeley by 751086becSdrochner.\" the American National Standards Committee X3, on Information 851086becSdrochner.\" Processing Systems. 951086becSdrochner.\" 1051086becSdrochner.\" Redistribution and use in source and binary forms, with or without 1151086becSdrochner.\" modification, are permitted provided that the following conditions 1251086becSdrochner.\" are met: 1351086becSdrochner.\" 1. Redistributions of source code must retain the above copyright 1451086becSdrochner.\" notice, this list of conditions and the following disclaimer. 1551086becSdrochner.\" 2. Redistributions in binary form must reproduce the above copyright 1651086becSdrochner.\" notice, this list of conditions and the following disclaimer in the 1751086becSdrochner.\" documentation and/or other materials provided with the distribution. 1851086becSdrochner.\" 3. Neither the name of the University nor the names of its contributors 1951086becSdrochner.\" may be used to endorse or promote products derived from this software 2051086becSdrochner.\" without specific prior written permission. 2151086becSdrochner.\" 2251086becSdrochner.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 2351086becSdrochner.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2451086becSdrochner.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2551086becSdrochner.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 2651086becSdrochner.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2751086becSdrochner.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2851086becSdrochner.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2951086becSdrochner.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 3051086becSdrochner.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 3151086becSdrochner.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3251086becSdrochner.\" SUCH DAMAGE. 3351086becSdrochner.\" 3451086becSdrochner.\" @(#)frexp.3 8.1 (Berkeley) 6/4/93 3551086becSdrochner.\" 36*5175c414Swiz.Dd September 10, 2015 3751086becSdrochner.Dt FREXP 3 3851086becSdrochner.Os 3951086becSdrochner.Sh NAME 4051086becSdrochner.Nm frexp 4151086becSdrochner.Nd convert floating-point number to fractional and integral components 4251086becSdrochner.Sh LIBRARY 4351086becSdrochner.Lb libm 4451086becSdrochner.Sh SYNOPSIS 4551086becSdrochner.In math.h 4651086becSdrochner.Ft double 4751086becSdrochner.Fn frexp "double value" "int *exp" 4851086becSdrochner.Ft float 4951086becSdrochner.Fn frexpf "float value" "int *exp" 50d6d04bbfShe.Ft long double 51d6d04bbfShe.Fn frexpl "long double value" "int *exp" 5251086becSdrochner.Sh DESCRIPTION 5351086becSdrochnerThe 5451086becSdrochner.Fn frexp 5551086becSdrochnerfunction breaks a floating-point number into a normalized 5651086becSdrochnerfraction and an integral power of 2. 5751086becSdrochnerIt stores the integer in the 5851086becSdrochner.Em int 5951086becSdrochnerobject pointed to by 6051086becSdrochner.Fa exp . 6151086becSdrochner.Sh RETURN VALUES 6251086becSdrochnerThe 6351086becSdrochner.Fn frexp 6451086becSdrochnerfunction returns the value 6551086becSdrochner.Em x , 6651086becSdrochnersuch that 6751086becSdrochner.Em x 6851086becSdrochneris a 6951086becSdrochner.Em double 7079b996cbSjoergwith magnitude in the interval [1/2, 1) or zero, and 7151086becSdrochner.Fa value 7251086becSdrochnerequals 7351086becSdrochner.Em x 7451086becSdrochnertimes 2 raised to the power 7551086becSdrochner.Fa *exp . 7651086becSdrochnerIf 7751086becSdrochner.Fa value 7851086becSdrochneris zero, both parts of the result are zero. 7951086becSdrochner.Sh SEE ALSO 8051086becSdrochner.Xr ldexp 3 , 8151086becSdrochner.Xr math 3 , 8251086becSdrochner.Xr modf 3 8351086becSdrochner.Sh STANDARDS 8451086becSdrochnerThe 8551086becSdrochner.Fn frexp 8651086becSdrochnerfunction conforms to 8751086becSdrochner.St -ansiC . 88