18cf5ed51SMike Barcroft.\" Copyright (c) 2003 Mike Barcroft <mike@FreeBSD.org> 28cf5ed51SMike Barcroft.\" All rights reserved. 38cf5ed51SMike Barcroft.\" 48cf5ed51SMike Barcroft.\" Redistribution and use in source and binary forms, with or without 58cf5ed51SMike Barcroft.\" modification, are permitted provided that the following conditions 68cf5ed51SMike Barcroft.\" are met: 78cf5ed51SMike Barcroft.\" 1. Redistributions of source code must retain the above copyright 88cf5ed51SMike Barcroft.\" notice, this list of conditions and the following disclaimer. 98cf5ed51SMike Barcroft.\" 2. Redistributions in binary form must reproduce the above copyright 108cf5ed51SMike Barcroft.\" notice, this list of conditions and the following disclaimer in the 118cf5ed51SMike Barcroft.\" documentation and/or other materials provided with the distribution. 128cf5ed51SMike Barcroft.\" 138cf5ed51SMike Barcroft.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 148cf5ed51SMike Barcroft.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 158cf5ed51SMike Barcroft.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 168cf5ed51SMike Barcroft.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 178cf5ed51SMike Barcroft.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 188cf5ed51SMike Barcroft.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 198cf5ed51SMike Barcroft.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 208cf5ed51SMike Barcroft.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 218cf5ed51SMike Barcroft.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 228cf5ed51SMike Barcroft.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 238cf5ed51SMike Barcroft.\" SUCH DAMAGE. 248cf5ed51SMike Barcroft.\" 258cf5ed51SMike Barcroft.\" $FreeBSD$ 268cf5ed51SMike Barcroft.\" 2729bf6af8SDavid Schultz.Dd January 26, 2005 288cf5ed51SMike Barcroft.Dt FPCLASSIFY 3 298cf5ed51SMike Barcroft.Os 308cf5ed51SMike Barcroft.Sh NAME 315d62092fSMike Barcroft.Nm fpclassify , isfinite , isinf , isnan , isnormal 328cf5ed51SMike Barcroft.Nd "classify a floating-point number" 338cf5ed51SMike Barcroft.Sh LIBRARY 343bdf0265SDavid Schultz.Lb libm 358cf5ed51SMike Barcroft.Sh SYNOPSIS 368cf5ed51SMike Barcroft.In math.h 378cf5ed51SMike Barcroft.Ft int 388cf5ed51SMike Barcroft.Fn fpclassify "real-floating x" 395d62092fSMike Barcroft.Ft int 405d62092fSMike Barcroft.Fn isfinite "real-floating x" 415d62092fSMike Barcroft.Ft int 425d62092fSMike Barcroft.Fn isinf "real-floating x" 435d62092fSMike Barcroft.Ft int 445d62092fSMike Barcroft.Fn isnan "real-floating x" 455d62092fSMike Barcroft.Ft int 465d62092fSMike Barcroft.Fn isnormal "real-floating x" 478cf5ed51SMike Barcroft.Sh DESCRIPTION 488cf5ed51SMike BarcroftThe 498cf5ed51SMike Barcroft.Fn fpclassify 508cf5ed51SMike Barcroftmacro takes an argument of 510e35e492SRuslan Ermilov.Fa x 528cf5ed51SMike Barcroftand returns one of the following manifest constants. 538cf5ed51SMike Barcroft.Bl -tag -width ".Dv FP_SUBNORMAL" 548cf5ed51SMike Barcroft.It Dv FP_INFINITE 558cf5ed51SMike BarcroftIndicates that 560e35e492SRuslan Ermilov.Fa x 578cf5ed51SMike Barcroftis an infinite number. 588cf5ed51SMike Barcroft.It Dv FP_NAN 598cf5ed51SMike BarcroftIndicates that 600e35e492SRuslan Ermilov.Fa x 618cf5ed51SMike Barcroftis not a number (NaN). 628cf5ed51SMike Barcroft.It Dv FP_NORMAL 638cf5ed51SMike BarcroftIndicates that 640e35e492SRuslan Ermilov.Fa x 658cf5ed51SMike Barcroftis a normalized number. 668cf5ed51SMike Barcroft.It Dv FP_SUBNORMAL 678cf5ed51SMike BarcroftIndicates that 680e35e492SRuslan Ermilov.Fa x 698cf5ed51SMike Barcroftis a denormalized number. 708cf5ed51SMike Barcroft.It Dv FP_ZERO 718cf5ed51SMike BarcroftIndicates that 720e35e492SRuslan Ermilov.Fa x 730e35e492SRuslan Ermilovis zero (0 or \-0). 748cf5ed51SMike Barcroft.El 755d62092fSMike Barcroft.Pp 765d62092fSMike BarcroftThe 775d62092fSMike Barcroft.Fn isfinite 785d62092fSMike Barcroftmacro returns a non-zero value if and only if its argument has 790e35e492SRuslan Ermilova finite (zero, subnormal, or normal) value. 800e35e492SRuslan ErmilovThe 815d62092fSMike Barcroft.Fn isinf , 825d62092fSMike Barcroft.Fn isnan , 835d62092fSMike Barcroftand 845d62092fSMike Barcroft.Fn isnormal 855d62092fSMike Barcroftmacros return non-zero if and only if 860e35e492SRuslan Ermilov.Fa x 875d62092fSMike Barcroftis an infinity, NaN, 885d62092fSMike Barcroftor a non-zero normalized number, respectively. 895d62092fSMike Barcroft.Pp 905d62092fSMike BarcroftThe symbol 915d62092fSMike Barcroft.Fn isnanf 925d62092fSMike Barcroftis provided as an alias to 935d62092fSMike Barcroft.Fn isnan 945d62092fSMike Barcroftfor compatibility, and its use is deprecated. 9529bf6af8SDavid SchultzSimilarly, 9629bf6af8SDavid Schultz.Fn finite 9729bf6af8SDavid Schultzand 9829bf6af8SDavid Schultz.Fn finitef 9929bf6af8SDavid Schultzare deprecated versions of 10029bf6af8SDavid Schultz.Fn isfinite . 1018cf5ed51SMike Barcroft.Sh SEE ALSO 1025d62092fSMike Barcroft.Xr isgreater 3 , 1035d62092fSMike Barcroft.Xr math 3 , 1045d62092fSMike Barcroft.Xr signbit 3 1058cf5ed51SMike Barcroft.Sh STANDARDS 1068cf5ed51SMike BarcroftThe 1075d62092fSMike Barcroft.Fn fpclassify , 1085d62092fSMike Barcroft.Fn isfinite , 1095d62092fSMike Barcroft.Fn isinf , 1105d62092fSMike Barcroft.Fn isnan , 1115d62092fSMike Barcroftand 1125d62092fSMike Barcroft.Fn isnormal 1135d62092fSMike Barcroftmacros conform to 1148cf5ed51SMike Barcroft.St -isoC-99 . 1158cf5ed51SMike Barcroft.Sh HISTORY 1168cf5ed51SMike BarcroftThe 1175d62092fSMike Barcroft.Fn fpclassify , 1185d62092fSMike Barcroft.Fn isfinite , 1195d62092fSMike Barcroft.Fn isinf , 1205d62092fSMike Barcroft.Fn isnan , 1215d62092fSMike Barcroftand 1225d62092fSMike Barcroft.Fn isnormal 1235d62092fSMike Barcroftmacros were added in 1248cf5ed51SMike Barcroft.Fx 5.1 . 1255d62092fSMike Barcroft.Bx 3 1265d62092fSMike Barcroftintroduced 1275d62092fSMike Barcroft.Fn isinf 1285d62092fSMike Barcroftand 1295d62092fSMike Barcroft.Fn isnan 1305d62092fSMike Barcroftfunctions, which accepted 1310e35e492SRuslan Ermilov.Vt double 1325d62092fSMike Barcroftarguments; these have been superseded by the macros 1335d62092fSMike Barcroftdescribed above. 134