Re: tcl8.5: large float-value to very wide int ?
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

Re: tcl8.5: large float-value to very wide int ?

From: Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at>
Date: Mon Dec 12 2005 - 12:40:45 CET

Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> wrote:
> I would have hoped for sthg like: 1[string repeat 0 49]
> I know, "decimal vs binary" and all that... :-(
> While it is exactly what I asked for, I now notice that
> my question was wrong in the first place.
Since the floating-point sqrt might return (due to
rounding) a result actually larger than the real
square-root, it wouldn't have helped me anyway...
(I needed it for a "lower bound")

> string map {\\\n {}} [exec bc -q << [format sqrt(%lld)\n $n]]
Meanwhile changed to:
      string map {\\\n {}} [exec dc -e ${n}vp]]

   ... [scan [string map ... [exec dc -e 16o${n}vp]] %llx] ...
turned out to be slower... why is conversion from
decimal faster than from hexadecimal?

> oh, there is also "dc", but how do I efficiently read in
> a "P"-style output from "dc" ?)

This is void anyway, due to deficiencies of [exec] :-(
Received on Fri Dec 23 18:58:39 2005