Artifacts Associated With Ticket 809784ffffffffff
Ticket change [28fcafd132] (rid 88797) by nobody on 2003-09-20 15:31:42:
- assignee initialized to: "dkf"
- cmimetype initialized to: "text/plain"
- comment initialized to:
This fails on 8.4.2 and 8.4.4, Windows version at least: % expr round(1234567890123456789) 1234567890123456789 % expr round(12345678901234567890) -6101065172474983726 % expr round(123456789012345678900) integer value too large to represent -- gary garyfeng at duke dot edu
- foundin initialized to: "obsolete: 8.4.4"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "18. Commands M-Z"
- title initialized to: "expr round(12345678901234567890)"
- type initialized to: "Bug"
Ticket change [5c9265ed2e] (rid 115328) by dkf on 2003-09-20 22:50:56:
- closedate changed to: "2003-09-20T15:50:56"
- closer changed to: "dkf"
- icomment:
Logged In: YES user_id=79902 Tcl integers are signed 64-bit values (modulo some complexity which doesn't matter here.) 1234567890123456789 is a value that is precisely representable as a signed 64-bit value, and so is OK. 12345678901234567890 is not, but can be represented as an *unsigned* 64-bit value so we can still parse it (and get the same bit representation) but it is interpreted as a signed 64-bit value and so comes out looking quite different (you can use the [scan] command to print it as an unsigned value if necessary.) 123456789012345678900 is not representable at all in a 64-bit quantity. If you have to work with integers of this size, check out the mpexpr extension. And rest assured that before 8.4 you would have hit the limit with much smaller values (i.e. 32-bits) on your platform! :^/ ("Fixing" this in the core really requires access to a high-quality unencumbered arbitrary-precision arithmetic library, but those are kind-of rare on the ground.) - login: "dkf"
- mimetype: "text/plain"
- resolution changed to: "Invalid"
- status changed to: "Closed"
- subsystem changed to: "47. Bytecode Compiler"
- username: "dkf"
Ticket change [073bc96bf1] (rid 89354) by nobody on 2003-09-22 21:57:31:
- icomment:
Logged In: NO Thank, dkf. I was working on a microsecond timer/counter sort of thing with an arbitrary starting value. I was surprised it hits the upper limit of 64-bit system. I just thought round() should give a consistent answer. But I can easily add a check in my code. thanks for your reply! -- gary
- login: "nobody"
- mimetype: "text/plain"
- username: "nobody"
- icomment: