Skip to content
Tcl Source Code Artifact [d9a082453b]
Login

Artifact [d9a082453b]

Artifact d9a082453b59080874f0de5d52ec54886aad88b3:

Ticket change [d9a082453b] - Closed ticket [758488ffffffffff|758488ffff]: <i>pow(2,63) returns wrong result</i> plus 9 other changes by dgp on 2003-06-23 01:32:01.
D 2003-06-23T01:32:01
J assignee dgp
J closedate 2003-06-22T18:32:01
J closer dgp
J icomment Logged\sIn:\sYES\s\nuser_id=80530\n\n\nYour\sdemo\sscript\sdoes\snot\sshow\sanything\nwrong\swith\sthe\spow()\sfunction.\n\npow(2,63)\sshould\sreturn\sa\sdouble\srepresentation\nof\sthe\svalue\s2^63\s=\s9223372036854775808.\nIt\sdoes:\n\n%\sformat\s%.19g\s[expr\s{pow(2,63)}]\n9223372036854775808\n\nWhen\syou\spass\sthat\svalue\sto\swide(),\nthough,\syou\sask\sfor\sthe\swide\sinteger\nvalue\sof\s2^63,\swhich\scan't\sbe\sdone\nbecause\svalid\swide\sintegers\sare\sthose\nin\sthe\srange\s-2^63\sto\s(2^63)\s-\s1.\n\nUse\sof\s64-bit\sints\sdoes\snot\smake\soverflow\nissues\sgo\saway,\sit\sjust\schanges\swhere\nthey\shappen.\n\nOn\sthe\sother\smatter,\stry\sthis:\n\n%\sexpr\s{wide(1)\s<<\s62}\n4611686018427387904\n
J login dgp
J mimetype text/plain
J resolution Invalid
J status Closed
J subsystem 47.\sBytecode\sCompiler
J username dgp
K 758488ffffffffffffffffffffffffffffffffff
U dgp
Z f4ec697a1630edd22f32067a682b16bd