]> www.ginac.de Git - cln.git/blob - src/float/ffloat/elem/cl_FF_minus.cc
Fix some conversions to cl_SF, cl_FF, and cl_DF.
[cln.git] / src / float / ffloat / elem / cl_FF_minus.cc
1 // binary operator -
2
3 // General includes.
4 #include "base/cl_sysdep.h"
5
6 // Specification.
7 #include "cln/ffloat.h"
8
9
10 // Implementation.
11
12 #include "float/ffloat/cl_FF.h"
13
14 namespace cln {
15
16
17 const cl_FF operator- (const cl_FF& x1, const cl_FF& x2)
18 {
19   #ifdef FAST_FLOAT
20       float_to_FF(FF_to_float(x1) - FF_to_float(x2), return ,
21                   TRUE, TRUE, // Overflow und subnormale Zahl abfangen
22                   FALSE, // kein Underflow mit Ergebnis +/- 0.0 möglich
23                          // (nach Definition der subnormalen Zahlen)
24                   FALSE, FALSE // keine Singularität, kein NaN als Ergebnis möglich
25                  );
26   #else
27       var ffloat x2_ = cl_ffloat_value(x2);
28       if (FF_uexp(x2_) == 0)
29         { return x1; }
30         else
31         { return x1 + allocate_ffloat(x2_ ^ bit(31)); }
32   #endif
33 }
34
35 }  // namespace cln