Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2006-11-23
03:23 • Ticket [1510060fff] string is double -strict versus expr int() status st... artifact: 42f100017d user: dgp
2006-06-22
14:53 • Ticket [1510060fff]: 2 changes artifact: 8035d75432 user: dkf
2006-06-21
15:41 • New ticket [1510060fff]. artifact: 5e1ddabacf user: nobody

[string is double -strict] versus [expr int()]

Open1510060fffffffffffffffffffffffffffffffffCreated 20 years agoUpdated 20 years ago
Descriptionplain2006-06-21 15:41:11
My code looks like this:

    if {[string is double -strict $x]} {
      set y [expr {int($x)}]
    }

This causes an error in the int($x) expression
when $x had a value of NaN.

I'm not sure what ought to be done about this.
I just want to record the problem so that I
don't forget about.
dkf Ticket [1510060fff]: 2 changes [History diff]2006-06-22 14:53:06
dgp Ticket [1510060fff]: 1 change [History diff]2006-11-23 03:23:52
Log in (anonymous is fine) to add a comment.