ReactOS
0.4.16-dev-433-g6363f78
Toggle main menu visibility
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
Functions
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
Variables
_
c
d
e
f
g
h
i
l
n
o
p
s
t
u
x
Typedefs
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
x
Enumerations
_
c
d
f
i
l
m
o
p
s
t
w
x
Enumerator
a
b
c
d
e
f
g
h
i
m
n
o
p
r
s
t
u
v
w
x
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
h
i
k
l
m
n
o
p
r
s
t
u
v
w
z
Enumerator
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Related Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
v
x
Files
File List
File Members
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Examples
fpclass.c
Go to the documentation of this file.
1
/*
2
* COPYRIGHT: See COPYING in the top level directory
3
* PROJECT: ReactOS system libraries
4
* FILE: lib/sdk/crt/float/fpclass.c
5
* PURPOSE: Floating-point classes
6
* PROGRAMER: Pierre Schweitzer (pierre@reactos.org)
7
* REFERENCE: http://babbage.cs.qc.cuny.edu/IEEE-754/References.xhtml
8
*/
9
10
#include <precomp.h>
11
#include <float.h>
12
#include <
internal/ieee.h
>
13
14
/*
15
* @implemented
16
*/
17
int
_fpclass
(
double
__d)
18
{
19
union
20
{
21
double
* __d;
22
double_s
*
d
;
23
}
d
;
24
d
.__d = &__d;
25
26
27
/* With 0x7ff, it can only be infinity or NaN */
28
if
(
d
.d->exponent == 0x7ff)
29
{
30
if
(
d
.d->mantissah == 0 &&
d
.d->mantissal == 0)
31
{
32
return
(
d
.d->sign == 0) ?
_FPCLASS_PINF
:
_FPCLASS_NINF
;
33
}
34
/* Windows will never return Signaling NaN */
35
else
36
{
37
return
_FPCLASS_QNAN
;
38
}
39
}
40
41
/* With 0, it can only be zero or denormalized number */
42
if
(
d
.d->exponent == 0)
43
{
44
if
(
d
.d->mantissah == 0 &&
d
.d->mantissal == 0)
45
{
46
return
(
d
.d->sign == 0) ?
_FPCLASS_PZ
:
_FPCLASS_NZ
;
47
}
48
else
49
{
50
return
(
d
.d->sign == 0) ?
_FPCLASS_PD
:
_FPCLASS_ND
;
51
}
52
}
53
/* Only remain normalized numbers */
54
else
55
{
56
return
(
d
.d->sign == 0) ?
_FPCLASS_PN
:
_FPCLASS_NN
;
57
}
58
}
_fpclass
int _fpclass(double __d)
Definition:
fpclass.c:17
_FPCLASS_PZ
#define _FPCLASS_PZ
Definition:
float.h:78
_FPCLASS_PD
#define _FPCLASS_PD
Definition:
float.h:79
_FPCLASS_PN
#define _FPCLASS_PN
Definition:
float.h:80
_FPCLASS_ND
#define _FPCLASS_ND
Definition:
float.h:76
_FPCLASS_QNAN
#define _FPCLASS_QNAN
Definition:
float.h:73
_FPCLASS_NINF
#define _FPCLASS_NINF
Definition:
float.h:74
_FPCLASS_NN
#define _FPCLASS_NN
Definition:
float.h:75
_FPCLASS_NZ
#define _FPCLASS_NZ
Definition:
float.h:77
_FPCLASS_PINF
#define _FPCLASS_PINF
Definition:
float.h:81
d
#define d
Definition:
ke_i.h:81
ieee.h
double_s
Definition:
ieee.h:10
sdk
lib
crt
float
fpclass.c
Generated on Tue Jan 7 2025 06:18:17 for ReactOS by
1.9.6