]> www.ginac.de Git - cln.git/blob - src/integer/conv/cl_I_mul10plus.cc
3f1fde99850a18eb408fce917fd772e395612e4c
[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 "cl_integer.h"
8
9
10 // Implementation.
11
12 #include "cl_I.h"
13 #include "cl_DS.h"
14
15 const cl_I mul_10_plus_x (const cl_I& y, unsigned char x)
16 {
17         CL_ALLOCA_STACK;
18         var uintD* MSDptr;
19         var uintC len;
20         var uintD* LSDptr;
21         I_to_NDS_1(y, MSDptr=,len=,LSDptr=); // NDS zu Y
22         var uintD carry = mulusmall_loop_lsp(10,LSDptr,len,x); // mal 10, plus x
23         if (!(carry==0))
24                 { lsprefnext(MSDptr) = carry; len++; }
25         return UDS_to_I(MSDptr,len); // UDS als Integer zurück
26 }