projects
/
oweals
/
musl.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
catch invalid ld80 bit patterns and treat them as nan
[oweals/musl.git]
/
src
/
math
/
__fpclassifyf.c
1
#include <stdint.h>
2
#include <math.h>
3
4
int __fpclassifyf(float __x)
5
{
6
union {
7
float __f;
8
__uint32_t __i;
9
} __y = { __x };
10
int __ee = __y.__i>>23 & 0xff;
11
if (!__ee) return __y.__i<<1 ? FP_SUBNORMAL : FP_ZERO;
12
if (__ee==0xff) return __y.__i<<9 ? FP_NAN : FP_INFINITE;
13
return FP_NORMAL;
14
}