Skip to content
Tcl Source Code Artifact [7ae5ac01d9]
Login

Artifact [7ae5ac01d9]

Artifact 7ae5ac01d9031c7c14ed76fbc997de6994476414:

Ticket change [7ae5ac01d9] - Ticket [1527169fffffffff|1527169fff] <i>[scan] incompatibility</i> status still Open with 4 other changes by kennykb on 2006-07-30 23:51:38.
D 2006-07-30T23:51:38
J icomment Logged\sIn:\sYES\s\nuser_id=99768\n\nAlas,\sTcl\shas\shad\sa\sgreat\smany\sinconsistencies\sover\stime\nwith\sthe\sway\sthat\sintegers\slarger\sthan\sthe\sprecision\sof\sthe\nmachine\sare\shandled,\sand\sthe\sway\sthat\sdifferences\samong\nmachines\sare\shandled.\n\nMoving\sforward,\swe've\staken\sthe\sapproach\sin\s8.5\sthat\sTcl's\nintegers\sare\sof\sarbitrary\sprecision,\sand\sprovided\s%llx,\n%llo,\s%llu\sand\s%lld\sformat\sgroups\sthat\swork\sthe\ssame\son\sall\nplatforms.\s\sWe've\salso\sadopted\sthe\sidea\sthat\s%x,\s%o,\s%u\sand\n%d\sare\sthe\swidth\sof\sa\snative\s'long\sint'\sor\s'long\sunsigned\nint'\s-\swhatever\sthat\sis\son\sthe\splatform\s-\sand\sthat\s%lx,\s%lo,\n%lu,\sand\s%ld\sare\sthe\swidth\sof\sa\s'long\slong'\s(or\s__int64\sin\nthe\sMicrosoft\scompilers)\sor\s'unsigned\slong\slong'\s(unsigned\n__int64).\n\nThis\sdoes\sindeed\sintroduce\sa\shandful\sof\sincompatibilities,\nbut\sit\salso\sfixes\sa\snumber\sof\sinsidious\sbugs,\sof\swhich\sthe\nones\smentioned\sin\sTIP\s#237\sare\srepresentative.\n\nTo\sconstrain\san\sinteger\sto\s'signed\s32-bit',\sirrespective\sof\nthe\splatform's\sinteger\swidth\sor\sthe\sinput\sformat,\sthe\neasiest\sthing\sat\spresent\sis\sto\scombine\sthe\sbit\sweights\syourself:\n\n\s\s\s\sexpr\s{($x\s&\s0x7fffffff)\s-\s($x\s&\s0x80000000)}\n\nThis\sexpression\swill\sgive\sthe\svalue\sof\sthe\sleast\ssignificant\n32\sbits\sof\sany\sinteger,\sinterpreted\sas\sa\ssigned\n(twos-complement)\s32-bit\squantity.\n
J login kennykb
J mimetype text/plain
J username kennykb
K 1527169fffffffffffffffffffffffffffffffff
U kennykb
Z 1666ca8848887daf4ab4fad52b91c2c4