From: Axel Kohlmeyer (
Date: Thu Dec 08 2011 - 22:37:16 CST

On Dec 8, 2011, at 11:05 PM, Ben Roberts <> wrote:

> Hi Gianluca,
> On 8/12/2011, at 9:26 PM, Gianluca Interlandi <> wrote:
>> Hi Ben,
>> Thanks a lot for your detailed descrition. I guess this applies also when programming in C/C++?
> Yes, that's correct. In fact, some compilers at some verbosity levels will warn you if you try to do a floating-point equality test. They'll usually proceed anyway, though. We know that most compilers (and interpreters, for that matter) will quite happily give us plenty of rope with which to hang ourselves.
>> Do you know off hand how to force a particular printing format in TCL in order to limit the number of decimals to for example 8? (Something similar to printf "%0.8f" in awk).

What you are looking for is the format command. For example like this.

puts [format "%0,8f" $bar]


> I'm afraid I can't remember much of TCL programming – it's probably close on five years since I last had to do any. You can probably find the answer online as quickly or easily as I could.
> Good luck,
> Ben