1 // cl_decimal_string().
4 #include "base/cl_sysdep.h"
7 #include "cln/integer_io.h"
12 #include "integer/cl_I.h"
13 #include "base/digitseq/cl_DS.h"
14 #include "base/string/cl_sstring.h"
18 char * cl_decimal_string (const cl_I& x)
21 var uintC need = cl_digits_need(x,10);
22 var uintB* ziffern = cl_alloc_array(uintB,need); // Platz für die Ziffern
23 var cl_digits erg; erg.LSBptr = &ziffern[need];
24 I_to_digits(x,10,&erg); // Umwandlung in Ziffern
25 var char* result = cl_sstring((char*)erg.MSBptr,erg.len); // Ziffern in String schreiben