Files
Upsilon/liba/src/fpclassifyf.c
Émilie Feral 818c56bd45 [python] Enable float
Change-Id: I94111dd821fb3a9ef1e22ae5133c3a48285c52d5
2017-08-25 11:20:49 +02:00

21 lines
370 B
C

#include <math.h>
#include <private/ieee754.h>
int __fpclassifyf(float x) {
if (ieee754exp32(x) == 0) {
if (ieee754man32(x) == 0x0) {
return FP_ZERO;
} else {
return FP_SUBNORMAL;
}
}
if (ieee754exp32(x) == 0xFF) {
if (ieee754man32(x) == 0) {
return FP_INFINITE;
} else {
return FP_NAN;
}
}
return FP_NORMAL;
}