math: update isinf/isnan function comments after move to math.h
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
This commit is contained in:
parent
8d67708a08
commit
cd84d1c2d0
|
@ -228,7 +228,7 @@ extern int __signbitd (double x);
|
||||||
* supporting multiple floating point types. Thus, they are
|
* supporting multiple floating point types. Thus, they are
|
||||||
* now defined as macros. Implementations of the old functions
|
* now defined as macros. Implementations of the old functions
|
||||||
* taking double arguments still exist for compatibility purposes
|
* taking double arguments still exist for compatibility purposes
|
||||||
* (prototypes for them are in <ieeefp.h>). */
|
* (prototypes for them are earlier in this header). */
|
||||||
|
|
||||||
#if __GNUC_PREREQ (4, 4)
|
#if __GNUC_PREREQ (4, 4)
|
||||||
#define fpclassify(__x) (__builtin_fpclassify (FP_NAN, FP_INFINITE, \
|
#define fpclassify(__x) (__builtin_fpclassify (FP_NAN, FP_INFINITE, \
|
||||||
|
|
|
@ -4,9 +4,8 @@
|
||||||
*
|
*
|
||||||
* isinf is a <math.h> macro in the C99 standard. It was previously
|
* isinf is a <math.h> macro in the C99 standard. It was previously
|
||||||
* implemented as a function by newlib and is declared as such in
|
* implemented as a function by newlib and is declared as such in
|
||||||
* <ieeefp.h>. Newlib supplies it here as a function if the user
|
* <math.h>. Newlib supplies it here as a function if the user
|
||||||
* chooses to use <ieeefp.h> or needs to link older code compiled with the
|
* chooses to use it instead of the C99 macro.
|
||||||
* previous <math.h> declaration.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "fdlibm.h"
|
#include "fdlibm.h"
|
||||||
|
|
|
@ -53,7 +53,7 @@ ANSI_SYNOPSIS
|
||||||
int isnormal(real-floating <[x]>);
|
int isnormal(real-floating <[x]>);
|
||||||
|
|
||||||
[Archaic SUSv2 functions:]
|
[Archaic SUSv2 functions:]
|
||||||
#include <ieeefp.h>
|
#include <math.h>
|
||||||
int isnan(double <[arg]>);
|
int isnan(double <[arg]>);
|
||||||
int isinf(double <[arg]>);
|
int isinf(double <[arg]>);
|
||||||
int finite(double <[arg]>);
|
int finite(double <[arg]>);
|
||||||
|
@ -142,7 +142,7 @@ o-
|
||||||
and <<isinf>> are macros that operate on multiple types of
|
and <<isinf>> are macros that operate on multiple types of
|
||||||
floating-point. The SUSv2 standard declares <<isnan>> as
|
floating-point. The SUSv2 standard declares <<isnan>> as
|
||||||
a function taking double. Newlib has decided to declare
|
a function taking double. Newlib has decided to declare
|
||||||
them both as macros in math.h and as functions in ieeefp.h to
|
them both as functions and as macros in math.h to
|
||||||
maintain backward compatibility.
|
maintain backward compatibility.
|
||||||
|
|
||||||
RETURNS
|
RETURNS
|
||||||
|
@ -154,9 +154,11 @@ The isnan macro returns nonzero if <[x]> is an NaN, else 0.@*
|
||||||
The isnormal macro returns nonzero if <[x]> has a normal value, else 0.
|
The isnormal macro returns nonzero if <[x]> has a normal value, else 0.
|
||||||
|
|
||||||
PORTABILITY
|
PORTABILITY
|
||||||
math.h macros are C99, POSIX.
|
math.h macros are C99, POSIX.1-2001.
|
||||||
|
|
||||||
ieeefp.h funtions are outdated and should be avoided.
|
The functions originate from BSD; isnan was listed in the X/Open
|
||||||
|
Portability Guide and Single Unix Specification, but was dropped when
|
||||||
|
the macro was standardized in POSIX.1-2001.
|
||||||
|
|
||||||
QUICKREF
|
QUICKREF
|
||||||
isnan - pure
|
isnan - pure
|
||||||
|
@ -179,8 +181,8 @@ QUICKREF
|
||||||
* The C99 standard dictates that isnan is a macro taking
|
* The C99 standard dictates that isnan is a macro taking
|
||||||
* multiple floating-point types while the SUSv2 standard
|
* multiple floating-point types while the SUSv2 standard
|
||||||
* notes it is a function taking a double argument. Newlib
|
* notes it is a function taking a double argument. Newlib
|
||||||
* has chosen to implement it as a macro in <math.h> and
|
* has chosen to declare it both as a function and as a macro in
|
||||||
* declare it as a function in <ieeefp.h>.
|
* <math.h> for compatibility.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "fdlibm.h"
|
#include "fdlibm.h"
|
||||||
|
|
|
@ -28,7 +28,7 @@ INDEX
|
||||||
finitef
|
finitef
|
||||||
|
|
||||||
ANSI_SYNOPSIS
|
ANSI_SYNOPSIS
|
||||||
#include <ieeefp.h>
|
#include <math.h>
|
||||||
int isnan(double <[arg]>);
|
int isnan(double <[arg]>);
|
||||||
int isinf(double <[arg]>);
|
int isinf(double <[arg]>);
|
||||||
int finite(double <[arg]>);
|
int finite(double <[arg]>);
|
||||||
|
@ -37,7 +37,7 @@ ANSI_SYNOPSIS
|
||||||
int finitef(float <[arg]>);
|
int finitef(float <[arg]>);
|
||||||
|
|
||||||
TRAD_SYNOPSIS
|
TRAD_SYNOPSIS
|
||||||
#include <ieeefp.h>
|
#include <math.h>
|
||||||
int isnan(<[arg]>)
|
int isnan(<[arg]>)
|
||||||
double <[arg]>;
|
double <[arg]>;
|
||||||
int isinf(<[arg]>)
|
int isinf(<[arg]>)
|
||||||
|
@ -77,8 +77,8 @@ DESCRIPTION
|
||||||
|
|
||||||
Note that by the C99 standard, <<isnan>> and <<isinf>> are macros
|
Note that by the C99 standard, <<isnan>> and <<isinf>> are macros
|
||||||
taking any type of floating-point and are declared in
|
taking any type of floating-point and are declared in
|
||||||
<<math.h>>. Newlib has chosen to declare these as macros in
|
<<math.h>>. Newlib has chosen to declare these both as functions
|
||||||
<<math.h>> and as functions in <<ieeefp.h>>.
|
and as macros in <<math.h>>.
|
||||||
|
|
||||||
The <<isnanf>>, <<isinff>> and <<finitef>> functions perform the same
|
The <<isnanf>>, <<isinff>> and <<finitef>> functions perform the same
|
||||||
operations as their <<isnan>>, <<isinf>> and <<finite>>
|
operations as their <<isnan>>, <<isinf>> and <<finite>>
|
||||||
|
|
|
@ -3,9 +3,8 @@
|
||||||
*
|
*
|
||||||
* isinf is a <math.h> macro in the C99 standard. It was previously
|
* isinf is a <math.h> macro in the C99 standard. It was previously
|
||||||
* implemented as isinf and isinff functions by newlib and are still declared
|
* implemented as isinf and isinff functions by newlib and are still declared
|
||||||
* as such in <ieeefp.h>. Newlib supplies it here as a function if the user
|
* as such in <math.h>. Newlib supplies it here as a function if the user
|
||||||
* chooses to use <ieeefp.h> or needs to link older code compiled with the
|
* chooses to use it instead of the C99 macro.
|
||||||
* previous <math.h> declaration.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "fdlibm.h"
|
#include "fdlibm.h"
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
/*
|
/*
|
||||||
* isnanf(x) returns 1 is x is nan, else 0;
|
* isnanf(x) returns 1 is x is nan, else 0;
|
||||||
*
|
*
|
||||||
* isnanf is an extension declared in <ieeefp.h>.
|
* isnanf is an extension declared in <math.h>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "fdlibm.h"
|
#include "fdlibm.h"
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
/*
|
/*
|
||||||
* On the SPU isinff(x) always returns 0.
|
* On the SPU isinff(x) always returns 0.
|
||||||
*
|
*
|
||||||
* isinff is an extension declared in <ieeefp.h>.
|
* isinff is an extension declared in <math.h>.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
isinff (float x)
|
isinff (float x)
|
||||||
|
|
Loading…
Reference in New Issue