]> www.ginac.de Git - cln.git/blob - src/float/lfloat/elem/cl_LF_uminus.cc
Extend the exponent range from 32 bits to 64 bits on selected platforms.
[cln.git] / src / float / lfloat / elem / cl_LF_uminus.cc
1 // unary operator -
2
3 // General includes.
4 #include "cl_sysdep.h"
5
6 // Specification.
7 #include "cln/lfloat.h"
8
9
10 // Implementation.
11
12 #include "cl_LF.h"
13 #include "cl_LF_impl.h"
14 #include "cl_DS.h"
15
16 namespace cln {
17
18 const cl_LF operator- (const cl_LF& x)
19 {
20 // Methode:
21 // Falls x=0.0, fertig. Sonst Vorzeichenbit umdrehen und Pointer beibehalten.
22       if (TheLfloat(x)->expo == 0)
23         { return x; }
24         else
25         { var uintC len = TheLfloat(x)->len;
26           var Lfloat mx = allocate_lfloat(len, TheLfloat(x)->expo, ~ TheLfloat(x)->sign);
27           copy_loop_up(&TheLfloat(x)->data[0],&TheLfloat(mx)->data[0],len);
28           return mx;
29         }
30 }
31
32 }  // namespace cln