repo.or.cz
/
musl.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
fix struct layout mismatch in sound ioctl time32 fallback conversion
[musl.git]
/
src
/
math
/
__fpclassifyf.c
blob
fd00eb1bcdc62e08c2ed1c8bdb8ac09dce3d0b52
1
#include <math.h>
2
#include <stdint.h>
3
4
int
__fpclassifyf
(
float
x
)
5
{
6
union
{
float
f
;
uint32_t
i
;}
u
= {
x
};
7
int
e
=
u
.
i
>>
23
&
0xff
;
8
if
(!
e
)
return
u
.
i
<<
1
?
FP_SUBNORMAL
:
FP_ZERO
;
9
if
(
e
==
0xff
)
return
u
.
i
<<
9
?
FP_NAN
:
FP_INFINITE
;
10
return
FP_NORMAL
;
11
}