From: Gianluca Interlandi (gianluca_at_u.washington.edu)
Date: Thu Dec 08 2011 - 20:27:28 CST

Hi Hyun,

So, it's really related just to the version of TCL and not necessarily to
64 versus 32 bit systems. I see that you have a 32 bit Ubuntu
installation, right? Maybe it will be fixed in future versions.

Thanks,

      Gianluca

On Fri, 9 Dec 2011, Song, Hyundeok (songhk) wrote:

> Gianluca
>
> Yes. If I only install Tcl 8.5, I have same problem.
>
> 0.1
> 0.2
> 0.30000000000000004
> 0.4
> 0.5
> 0.6000000000000001
> 0.7000000000000001
> 0.8
> 0.9
> 1.0
>
> 2.6.32-36-generic #79-Ubuntu SMP, i686 GNU/Linux
>
>
> So I installed Tcl 8.4 again, then it came back.
>
> 0.1
> 0.2
> 0.3
> 0.4
> 0.5
> 0.6
> 0.7
> 0.8
> 0.9
> 1.0
>
> I don't know where this bug come, but I want let you know it.
>
> Hyun.
> ________________________________________
> From: owner-vmd-l_at_ks.uiuc.edu [owner-vmd-l_at_ks.uiuc.edu] on behalf of Gianluca Interlandi [gianluca_at_u.washington.edu]
> Sent: Thursday, December 08, 2011 7:09 PM
> To: vmd-l_at_ks.uiuc.edu
> Subject: vmd-l: TCL strangeness
>
> Hi,
>
> I have a question which concerns more TCL rather than VMD. I noticed
> somthing strange (bug?) with TCL version 8.5 on 64 bit Linux
> installations (openSUSE 11.1 and above).
>
> For some reason multiplication of an integer with a decimal number gives a
> weird result (both in the VMD Tk console and using tclsh in the console).
> For example:
>
> expr 3*0.1
>
> returns:
>
> 0.30000000000000004
>
> For example, if I run a loop, I get:
>
> for {set i 1} {$i<=10} {incr i} {
> set j [expr $i*0.1]
> puts $j
> }
>
> 0.1
> 0.2
> 0.30000000000000004
> 0.4
> 0.5
> 0.6000000000000001
> 0.7000000000000001
> 0.8
> 0.9
> 1.0
>
>
> Has anybody else had the same problem? Is there a workaround?
>
> Thanks,
>
> Gianluca
>
> -----------------------------------------------------
> Gianluca Interlandi, PhD gianluca_at_u.washington.edu
> +1 (206) 685 4435
> http://artemide.bioeng.washington.edu/
>
> Postdoc at the Department of Bioengineering
> at the University of Washington, Seattle WA U.S.A.
> -----------------------------------------------------
>
>
>

-----------------------------------------------------
Gianluca Interlandi, PhD gianluca_at_u.washington.edu
                     +1 (206) 685 4435
                     http://artemide.bioeng.washington.edu/

Postdoc at the Department of Bioengineering
at the University of Washington, Seattle WA U.S.A.
-----------------------------------------------------