]> www.ginac.de Git - cln.git/blob - src/integer/conv/cl_I_from_NUDS.cc
Fix integer input with leading zeros in power-of-two base.
[cln.git] / src / integer / conv / cl_I_from_NUDS.cc
1 // NUDS_to_I().
2
3 // General includes.
4 #include "base/cl_sysdep.h"
5
6 // Specification.
7 #include "integer/cl_I.h"
8
9
10 // Implementation.
11
12 #include "cln/number.h"
13 #include "base/digitseq/cl_DS.h"
14
15 #include "base/cl_inline.h"
16 #include "integer/conv/cl_I_from_NDS.cc"
17
18 namespace cln {
19
20 CL_INLINE2 const cl_I CL_INLINE2_DECL(NUDS_to_I) (uintD* MSDptr, uintC len)
21 {
22         if ((!(len==0)) && ((sintD)mspref(MSDptr,0) < 0))
23                 // Falls die Länge >0 und das Most significant Bit = 1 sind,
24                 // die Digit Sequence um ein Nulldigit erweitern:
25                 { lsprefnext(MSDptr) = 0; len++; }
26         return NDS_to_I_inline(MSDptr,len);
27 }
28
29 }  // namespace cln