Blame view

epsilon-master/liba/src/fpclassifyf.c 370 Bytes
6663b6c9   adorian   projet complet av...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
  #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;
  }