]> www.ginac.de Git - cln.git/blob - src/float/ffloat/elem/cl_FF_uminus.cc
* All Files have been modified for inclusion of namespace cln;
[cln.git] / src / float / ffloat / elem / cl_FF_uminus.cc
1 // unary operator -
2
3 // General includes.
4 #include "cl_sysdep.h"
5
6 // Specification.
7 #include "cln/ffloat.h"
8
9
10 // Implementation.
11
12 #include "cl_FF.h"
13
14 namespace cln {
15
16 const cl_FF operator- (const cl_FF& x)
17 {
18 // Methode:
19 // Falls x=0.0, fertig. Sonst Vorzeichenbit umdrehen.
20       var ffloat x_ = cl_ffloat_value(x);
21       if (FF_uexp(x_) == 0)
22         return x;
23       else
24         return allocate_ffloat( x_ ^ bit(31) );
25 }
26
27 }  // namespace cln