From: Hopsing K <hop...@gm...> - 2012-06-12 11:48:16
|
I wonder weather intprint.d:digits_need() doesnt return a value too big. Shouldnt it be: diff -Naur clisp-2.49/src/intprint.d.ori clisp-2.49/src/intprint.d --- clisp-2.49/src/intprint.d.ori 2012-06-12 13:40:17.000000000 +0200 +++ clisp-2.49/src/intprint.d 2012-06-12 13:40:45.000000000 +0200 @@ -125,7 +125,7 @@ local uintL digits_need (uintC len, uintWL base) { # 1+ceiling(len * intDsize*log(2)/log(base)) Bytes oder etwas mehr - var uintL need = 1+floor(len,1024/intDsize); # > ceiling(len*intDsize/1024) >= 0 + var uintL need = len; # > ceiling(len*intDsize/1024) >= 0 switch (base) { # need mit ceiling(1024*log(2)/log(base)) multiplizieren: case 2: need = 1024*need; break; case 3: need = 647*need; break; @@ -165,6 +165,7 @@ default: NOTREACHED; } # Nun gilt need >= len*intDsize*log(2)/log(base). + need = floor(need,1024/intDsize); need += 1; # Platzbedarf in Bytes return need; } => The floor() at the end... |