Artifacts Associated With Ticket 1230346
Ticket change [4cf3e1a793] (rid 126981) by matzek on 2005-06-30 13:19:20:
- assignee initialized to: "dkf"
- cmimetype initialized to: "text/plain"
- comment initialized to:
Maybe related to bug [ 718878 ]. On a 32bit Linux system using Tcl 8.4.9: % set foo 4294967295 4294967295 % string is integer $foo 1 % set foo 4294967296 4294967296 % string is integer $foo 0 % set foo 2147483648 2147483648 % string is integer $foo 1 % set foo 2147483647 2147483647 % string is integer $foo 1 On a 64bit Solaris 5.8 system using a 64bit Tcl 8.4.9: % set foo 4294967295 4294967295 % string is integer $foo 0 % set foo 4294967296 4294967296 % string is integer $foo 0 % set foo 2147483648 2147483648 % string is integer $foo 0 % set foo 2147483647 2147483647 % string is integer $foo 1 So there are different results in the range from 2147483648 (1<<31) up to (and including) 4294967295 ((1<<32)-1). -- Matthias Kraft
- foundin initialized to: "obsolete: 8.4.9"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "matzek"
- subsystem initialized to: "18. Commands M-Z"
- title initialized to: "Another [string is integer] inconsistency"
- type initialized to: "Bug"
Ticket change [439c303484] (rid 116591) by dkf on 2005-06-30 20:35:24:
- assignee changed to: "kennykb"
Ticket change [462bfb0b9b] (rid 99478) by dgp on 2005-06-30 21:09:09:
- icomment:
Logged In: YES user_id=80530 [string is integer] is meant to tell you whether a value can have Tcl_GetIntFromObj() called on it. Since sizeof(int) can be different on different systems, so can the results of [string is integer]. That said, your 64-bit results look wrong.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [c99fb1a906] (rid 122319) by matzek on 2005-06-30 23:23:02:
- icomment:
Logged In: YES user_id=330806 Well, from my point of view I don't care about Tcl_GetIntFromObj(). Script level is what counts, if script level commands are used. I want to know if the user or system provided a valid integer, not a string, nor a double or whatever ... The big numbers are essential, as I am going to check whether or not I have enough place on the filesystem (e. g. in this case for creating databases). Currently I use [regexp -- {^-?[0-9]+$} $size] to validate the value I got from the system. But I do it quite a number of times, so I'd like to get rid of regexp, if there is a faster method... -- Matthias Kraft - login: "matzek"
- mimetype: "text/plain"
- username: "matzek"
- icomment:
Ticket change [214dd51f1a] (rid 130559) by dgp on 2005-06-30 23:29:59:
- icomment:
Logged In: YES user_id=80530 Actually, yes you do care. Some commands accept only those arguments that pass Tcl_GetIntFromObj. For example, [lindex $list $index] Forgetting for a moment the special forms "end-", etc. for indices, if $index is a string of digits, then you need then to be digits that pass [string is integer $index]. % string is integer 9999999999 0 % lindex c 9999999999 bad index "9999999999": must be integer?[+-]integer? or end?[+-]integer? So, you need to choose the validation command that matches your intended use. It might be [string is wideinteger]. It might be your regexp. All depends on what your eventual use will accept/reject. Choose the matching validator.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [bce723356f] (rid 101826) by kennykb on 2005-08-06 02:28:32:
- icomment:
Logged In: YES user_id=99768 I think that Matthias needs the 8.5 [string is wide] functionality.
- login: "kennykb"
- mimetype: "text/plain"
- username: "kennykb"
- icomment:
Ticket change [ed0bc7de96] (rid 103814) by kennykb on 2005-11-05 02:40:42:
- icomment:
Logged In: YES user_id=99768 In 8.5, we have [string is integer], [string is wideinteger] and [string is bignum]. In 8.4, we have [string is integer] and [string is wideinteger]. The user should choose the validator that suits his needs, as dgp said before.
- login: "kennykb"
- mimetype: "text/plain"
- resolution changed to: "Invalid"
- status changed to: "Closed"
- username: "kennykb"
- icomment:
Ticket change [fa59c78d53] (rid 91851) by kennykb on 2005-11-05 02:40:43:
- closedate changed to: "2005-11-04T19:40:43"
- closer changed to: "kennykb"