Subversion Repositories Kolibri OS

Rev

Rev 1906 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1906 Rev 3362
Line 7... Line 7...
7
 * software is freely granted, provided that this notice 
7
 * software is freely granted, provided that this notice 
8
 * is preserved.
8
 * is preserved.
9
 * ====================================================
9
 * ====================================================
10
 */
10
 */
Line -... Line 11...
-
 
11
 
-
 
12
/*
-
 
13
FUNCTION
-
 
14
	<>, <>, <>, <>, <>, <>---test for exceptional numbers
-
 
15
 
-
 
16
INDEX
-
 
17
	isnan
-
 
18
INDEX
-
 
19
	isinf
-
 
20
INDEX
-
 
21
	finite
-
 
22
 
-
 
23
INDEX
-
 
24
	isnanf
-
 
25
INDEX
-
 
26
	isinff
-
 
27
INDEX
-
 
28
	finitef
-
 
29
 
-
 
30
ANSI_SYNOPSIS
-
 
31
	#include 
-
 
32
	int isnan(double <[arg]>);
-
 
33
	int isinf(double <[arg]>);
-
 
34
	int finite(double <[arg]>);
-
 
35
	int isnanf(float <[arg]>);
-
 
36
	int isinff(float <[arg]>);
-
 
37
	int finitef(float <[arg]>);
-
 
38
 
-
 
39
TRAD_SYNOPSIS
-
 
40
	#include 
-
 
41
	int isnan(<[arg]>)
-
 
42
	double <[arg]>;
-
 
43
	int isinf(<[arg]>)
-
 
44
	double <[arg]>;
-
 
45
	int finite(<[arg]>);
-
 
46
	double <[arg]>;
-
 
47
	int isnanf(<[arg]>);
-
 
48
	float <[arg]>;
-
 
49
	int isinff(<[arg]>);
-
 
50
	float <[arg]>;
-
 
51
	int finitef(<[arg]>);
-
 
52
	float <[arg]>;
-
 
53
 
-
 
54
 
-
 
55
DESCRIPTION
-
 
56
	These functions provide information on the floating-point
-
 
57
	argument supplied.
-
 
58
 
-
 
59
	There are five major number formats:
-
 
60
	o+
-
 
61
	o zero
-
 
62
	  A number which contains all zero bits.
-
 
63
	o subnormal
-
 
64
	  A number with a zero exponent but a nonzero fraction.
-
 
65
	o normal
-
 
66
	  A number with an exponent and a fraction.
-
 
67
     	o infinity
-
 
68
	  A number with an all 1's exponent and a zero fraction.
-
 
69
	o NAN
-
 
70
	  A number with an all 1's exponent and a nonzero fraction.
-
 
71
 
-
 
72
	o-
-
 
73
 
-
 
74
	<> returns 1 if the argument is a nan. <>
-
 
75
	returns 1 if the argument is infinity.  <> returns 1 if the
-
 
76
	argument is zero, subnormal or normal.
-
 
77
 
-
 
78
	Note that by the C99 standard, <> and <> are macros
-
 
79
	taking any type of floating-point and are declared in
-
 
80
	<>.  Newlib has chosen to declare these as macros in
-
 
81
	<> and as functions in <>.
-
 
82
	
-
 
83
	The <>, <> and <> functions perform the same
-
 
84
	operations as their <>, <> and <>
-
 
85
	counterparts, but on single-precision floating-point numbers.
-
 
86
 
-
 
87
QUICKREF
-
 
88
	isnan - pure
-
 
89
QUICKREF
-
 
90
	isinf - pure
-
 
91
QUICKREF
-
 
92
	finite - pure
-
 
93
QUICKREF
-
 
94
	isnan - pure
-
 
95
QUICKREF
-
 
96
	isinf - pure
-
 
97
QUICKREF
-
 
98
	finite - pure
Line 11... Line 99...
11
 
99
*/
12
 
100
 
13
/*
101
/*
14
 * __isnand(x) returns 1 is x is nan, else 0;
102
 * __isnand(x) returns 1 is x is nan, else 0;
Line 15... Line 103...
15
 * no branching!
103
 * no branching!
Line -... Line 104...
-
 
104
 */
-
 
105
 
16
 */
106
#include "fdlibm.h"
17
 
107
 
18
#include "fdlibm.h"
108
#ifndef _DOUBLE_IS_32BITS
19
 
109
 
20
int
110
int
Line 27... Line 117...
27
	hx |= (__uint32_t)(lx|(-lx))>>31;	
117
	hx |= (__uint32_t)(lx|(-lx))>>31;	
28
	hx = 0x7ff00000 - hx;
118
	hx = 0x7ff00000 - hx;
29
	return (int)(((__uint32_t)(hx))>>31);
119
	return (int)(((__uint32_t)(hx))>>31);
30
}
120
}
Line -... Line 121...
-
 
121