Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

problem with bigfloat in 8.5

9 views
Skip to first unread message

bill...@alum.mit.edu

unread,
May 8, 2008, 3:57:36 AM5/8/08
to
A program that works in 8.4.14 turns out not to work in 8.5. I have
traced the problem to math::bigfloat::todouble

package require math::bigfloat
namespace import ::math::bigfloat::*
set foo [fromstr 317.22 4]

In 8.4.1.4 the following prints 317.220, but in 8.5 it prints 0.000.

set sr [todouble $foo]
puts [format "%6.2f" $sr]

If I convert the bigfloat to a string, then convert the string back to
a float using scan, as below, the result is 317.220 in 8.5 as well as
8.4.14.

set str [tostr $foo]
scan $str "%f" sr
puts [format "%6.2f" $sr]

Is this a bug in todouble in 8.5?


In tcl 8.4.14 both

schlenk

unread,
May 8, 2008, 7:34:48 AM5/8/08
to

todouble is a command in the math::bigfloat namespace so it might not
have been updated to the new 8.5 float stuff with tcl_precision=0 yet.
If you set ::tcl_precision it might fix it, but thats not recommended
for 8.5. Better file a bug for the bigfloat package at tcllib. (and
check if the error exists with the latest version).

Michael

Larry W. Virden

unread,
May 8, 2008, 8:03:27 AM5/8/08
to
On May 8, 7:34 am, schlenk <schl...@uni-oldenburg.de> wrote:
>
> check if the error exists with the latest version).
>

I just tried the above using the latest ActiveTcl 8.5.2 and latest
tcllib in the teapot repository and get the 0.00 from the puts.

bill...@alum.mit.edu

unread,
May 8, 2008, 12:09:23 PM5/8/08
to
Thanks. I have filed the bug.
0 new messages