]> www.ginac.de Git - cln.git/blob - src/float/lfloat/misc/cl_LF_extend.cc
* */*: Remove cl_boolean, cl_true, and cl_false in favor of built-in
[cln.git] / src / float / lfloat / misc / cl_LF_extend.cc
1 // extend().
2
3 // General includes.
4 #include "cl_sysdep.h"
5
6 // Specification.
7 #include "cl_LF.h"
8
9
10 // Implementation.
11
12 #include "cl_LF_impl.h"
13 #include "cl_DS.h"
14
15 namespace cln {
16
17 const cl_LF extend (const cl_LF& x, uintC len)
18 {
19       var Lfloat y = allocate_lfloat(len,TheLfloat(x)->expo,TheLfloat(x)->sign); // neues LF
20       { var uintC oldlen = TheLfloat(x)->len; // alte Länge, < len
21         // Mantisse von x nach y kopieren:
22         var uintD* ptr = copy_loop_msp(arrayMSDptr(TheLfloat(x)->data,oldlen),arrayMSDptr(TheLfloat(y)->data,len),oldlen);
23         // und mit Null-Digits ergänzen:
24         clear_loop_msp(ptr,len-oldlen);
25       }
26       return y;
27 }
28
29 }  // namespace cln