]> www.ginac.de Git - cln.git/blob - src/integer/conv/cl_I_mul10plus.cc
* include/cln/number.h (As): Fix it in namespace by suffixing `_As'
[cln.git] / src / integer / conv / cl_I_mul10plus.cc
1 // mul_10_plus_x().
2
3 // General includes.
4 #include "cl_sysdep.h"
5
6 // Specification.
7 #include "cln/integer.h"
8
9
10 // Implementation.
11
12 #include "cl_I.h"
13 #include "cl_DS.h"
14
15 namespace cln {
16
17 const cl_I mul_10_plus_x (const cl_I& y, unsigned char x)
18 {
19         CL_ALLOCA_STACK;
20         var uintD* MSDptr;
21         var uintC len;
22         var uintD* LSDptr;
23         I_to_NDS_1(y, MSDptr=,len=,LSDptr=); // NDS zu Y
24         var uintD carry = mulusmall_loop_lsp(10,LSDptr,len,x); // mal 10, plus x
25         if (!(carry==0))
26                 { lsprefnext(MSDptr) = carry; len++; }
27         return UDS_to_I(MSDptr,len); // UDS als Integer zurück
28 }
29
30 }  // namespace cln