Version 9 of entier

Updated 2007-11-10 21:10:22 by dkf

expr function available since Tcl 8.5: Converts a number to some integral type (int, wide or bignum).

The name of this function is derived from French, via ALGOL.


LV So, this is functionally similar to a cast? What happens when the number being entiered doesn't fit into the size type? A bignum being cast into an int, for instance?

escargo 29 Nov 2006 - It's more like the round function. I think the point is that however big the number might be, it will pick the smallest integral type that will hold it. See TIP 237 [L1 ] for full details.

DKF: It's unspecified what size of value you get beyond "big enough", and a bignum is big enough to take any integer you want (assuming you've got the memory to hold it...)