digits_need

Hopsing K <[email protected]>
Newsgroups gmane.lisp.clisp.devel
Message-ID <CAN-KreNNAmdVFVYR5PRUtAc2W+gZjrcdR8AZ5nhZMv=H3PYANg@mail.gmail.com>
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...

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

_______________________________________________
clisp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/clisp-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.