Blame view

Modif/epsilon-master/liba/src/fpclassify.c 371 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 __fpclassify(double x) {
    if (ieee754exp64(x) == 0) {
      if (ieee754man64(x) == 0x0) {
        return FP_ZERO;
      } else {
        return FP_SUBNORMAL;
      }
    }
    if (ieee754exp64(x) == 0x7FF) {
      if (ieee754man64(x) == 0) {
        return FP_INFINITE;
      } else {
        return FP_NAN;
      }
    }
    return FP_NORMAL;
  }