|
From: Daniel A. S. <da...@ca...> - 2009-02-11 22:52:20
|
On Wed, Feb 11, 2009 at 22:37, Daniel A. Steffen
<da...@ca...> wrote:
> sure, my point was that [string is double] accepts all bignums,
> including those that cannot fit into a C double without loss of
> precision, or even those bigger than DBL_MAX...
leading to things like this:
% set x [expr {10**400}]
10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
% string is double $x
1
% expr {double($x)}
Inf
from the manpage text, I would not have expected an overflowing double
to be acceptable:
double Any of the valid forms for a double in Tcl, with
optional surrounding whitespace. In case of
under/overflow in the value, 0 is returned and the
varname will contain -1.
|