Browse Source

Fix crash in output of huge numbers.

master
Richard Kreckel 17 years ago
parent
commit
b044ba9e36
  1. 6
      ChangeLog
  2. 9
      NEWS
  3. 2
      src/integer/conv/cl_I_to_digits.cc
  4. 2
      src/integer/output/cl_I_print_string.cc

6
ChangeLog

@ -1,3 +1,9 @@
2007-02-06 Richard B. Kreckel <kreckel@ginac.de>
Fix crash in output of huge numbers:
* src/integer/conv/cl_I_to_digits.cc: Make erglen uintC.
* src/integer/output/cl_I_print_string.cc: Make B_baselen uintC.
2007-02-04 Richard B. Kreckel <kreckel@ginac.de> 2007-02-04 Richard B. Kreckel <kreckel@ginac.de>
Fix cl_F output of more than 2^32 decimal digits: Fix cl_F output of more than 2^32 decimal digits:

9
NEWS

@ -1,3 +1,12 @@
2008-mm-dd, version 1.2.1
=========================
Implementation changes
----------------------
* Fixed some bugs in the output of numbers larger than 2^32 decimal digits.
2008-01-19, version 1.2.0 2008-01-19, version 1.2.0
========================= =========================

2
src/integer/conv/cl_I_to_digits.cc

@ -191,7 +191,7 @@ void I_to_digits (const cl_I& X, uintD base, cl_digits* erg)
#endif #endif
var const cl_I& X1 = q; var const cl_I& X1 = q;
var const cl_I& X0 = r; var const cl_I& X0 = r;
var uintL B_baselen = (uintL)(k)<<i;
var uintC B_baselen = (uintC)(k)<<i;
I_to_digits_noshrink(X0,base,B_baselen,erg); I_to_digits_noshrink(X0,base,B_baselen,erg);
erg->LSBptr -= B_baselen; erg->LSBptr -= B_baselen;
I_to_digits(X1,base,erg); I_to_digits(X1,base,erg);

2
src/integer/output/cl_I_print_string.cc

@ -32,7 +32,7 @@ char * print_integer_to_string (unsigned int base, const cl_I& z)
I_to_digits(abs_z,(uintD)base,&erg); // Umwandlung in Ziffern I_to_digits(abs_z,(uintD)base,&erg); // Umwandlung in Ziffern
// Vorzeichen ankleben: // Vorzeichen ankleben:
var char* ergptr = (char*)erg.MSBptr; var char* ergptr = (char*)erg.MSBptr;
var uintL erglen = erg.len;
var uintC erglen = erg.len;
if (minus_p) { if (minus_p) {
*--ergptr = '-'; *--ergptr = '-';
erglen++; erglen++;

Loading…
Cancel
Save