blob: d36aa4087ea4a6e7483a7d9547a7a50c9996db2e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
#if 0
# define TGSOURCE "fma.c"
#include "_tgmath.h"
#include <math.h>
#include <fenv.h>
TYPE TGFN(fma)(TYPE x, TYPE y, TYPE z)
{
int classx = fpclassify(x);
int classy = fpclassify(y);
/* int classz = fpclassify(z); */
if (classx == FP_INFINITE && classy == FP_ZERO) {
feraiseexcept(FE_INVALID);
return NAN;
}
if (classx == FP_ZERO && classy == FP_INFINITE) {
feraiseexcept(FE_INVALID);
return NAN;
}
/*
if (x * y == -z && fpclassify(x*y) == classz == FP_INFINITE) {
feraiseexcept(FE_INVALID);
return NAN;
}
*/
return x * y + z;
}
/*
STDC(199901)
LINK(m)
*/
#endif
|