Version 2 of wide

Updated 2007-07-13 16:07:41 by LV

[discuss what tcl considers a variable of type wide]

An expr function that converts a number to a "wide integer" (i.e. an integer of at least 64-bits precision).

As JH observes on comp.lang.tcl, if you want a wide result, be sure to apply wide to one of the values in the expression - not the result of the expression.

In other words, this will not give you a wide result:

 expr wide( 80 * 1000000000 )

while this will:

 expr wide( 80 ) * 1000000000 

Of course, this applies to Tcl 8.4 and earlier. With Tcl 8.5, the expression works without the wide!


[Category Glossary|Category Internals]