]> www.ginac.de Git - cln.git/blob - src/integer/input/cl_I_readparsed.cc
Re-esatblish 1.2.0 ABI, broken 2008-02-22 [Alexei Sheplyakov].
[cln.git] / src / integer / input / cl_I_readparsed.cc
1 // read_integer().
2
3 // General includes.
4 #include "cl_sysdep.h"
5
6 // Specification.
7 #include "cln/integer_io.h"
8
9
10 // Implementation.
11
12 #include "cl_I.h"
13
14 namespace cln {
15
16 #if intCsize > intLsize
17 const cl_I read_integer (unsigned int base, cl_signean sign, const char* string, uintL index1, uintL index2)
18 {
19         // XXX: This signature is for binary compatibility with CLN-1.2.0 only.
20         return read_integer(base, sign, string, uintC(index1), uintC(index2));
21 }
22 #endif
23
24 const cl_I read_integer (unsigned int base, cl_signean sign, const char * string, uintC index1, uintC index2)
25 {
26         var cl_I x = digits_to_I(&string[index1],index2-index1,(uintD)base);
27         if (sign == 0)
28                 return x;
29         else
30                 return -x; // negatives Vorzeichen -> Vorzeichenwechsel
31 }
32
33 }  // namespace cln