Skip to content
Tcl Source Code History Of Ticket 758488ffffffffff
Login

History Of Ticket 758488ffffffffff

Artifacts Associated With Ticket 758488ffffffffff

  1. Ticket change [7fc6308e01] (rid 97616) by hgschulz on 2003-06-21 18:09:02:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      Given the support for 64-bit numbers, there's no reason
      that
      pow(2,63) shouldn't do the right thing. Currently, it does
      
      expr wide(pow(2,63))
      9223372036854775807
      
      which is off by one. Other 64-bit computations are also
      odd:
      
      expr wide(1 << 62) 
      1073741824
      
      expr 1 << 62
      1073741824
      
      
      
      
    4. foundin initialized to: "obsolete: 8.4.3"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "hgschulz"
    9. subsystem initialized to: "None"
    10. title initialized to: "pow(2,63) returns wrong result"
    11. type initialized to: "Bug"
  2. Ticket change [d9a082453b] (rid 107642) by dgp on 2003-06-23 01:32:01:

    1. assignee changed to: "dgp"
    2. closedate changed to: "2003-06-22T18:32:01"
    3. closer changed to: "dgp"
    4. icomment:
      Logged In: YES 
      user_id=80530
      
      
      Your demo script does not show anything
      wrong with the pow() function.
      
      pow(2,63) should return a double representation
      of the value 2^63 = 9223372036854775808.
      It does:
      
      % format %.19g [expr {pow(2,63)}]
      9223372036854775808
      
      When you pass that value to wide(),
      though, you ask for the wide integer
      value of 2^63, which can't be done
      because valid wide integers are those
      in the range -2^63 to (2^63) - 1.
      
      Use of 64-bit ints does not make overflow
      issues go away, it just changes where
      they happen.
      
      On the other matter, try this:
      
      % expr {wide(1) << 62}
      4611686018427387904
      
      
    5. login: "dgp"
    6. mimetype: "text/plain"
    7. resolution changed to: "Invalid"
    8. status changed to: "Closed"
    9. subsystem changed to: "47. Bytecode Compiler"
    10. username: "dgp"
  3. Ticket change [e941ed7ee7] (rid 104790) by hgschulz on 2003-06-23 01:43:20:

    1. icomment:
      Logged In: YES 
      user_id=115926
      
      The documentation at
      http://www.tcl.tk/man/tcl8.4/TclCmd/expr.htm does not
      indicate that pow() converts the arguments to double or that
      it returns a double.
      
      In addition, << and >> only mention that they work with
      'integers'. The documentation also says:
      
      "On 32-bit systems, integer values MAX_INT (0x7FFFFFFF) and
      MIN_INT (-0x80000000) will be represented as 32-bit values,
      and integer values outside that range will be represented as
      64-bit values (if that is possible at all.)"
      
      Thus, from the description, one can reasonably assume that 1
      << 48, say, will produce a valid 64-bit number, not some
      32-bit result.
      
      
      
    2. login: "hgschulz"
    3. mimetype: "text/plain"
    4. username: "hgschulz"
  4. Ticket change [8b75a9cdae] (rid 127572) by dgp on 2003-06-23 06:45:04:

    1. assignee changed to: "dkf"
    2. icomment:
      Logged In: YES 
      user_id=80530
      
      fair enough.  Assigning to the
      contributor of the latest 64-bit
      improvements for his opinion
      on what documentation
      improvements might be a good idea.
      
      If you can help with contributed
      improvements, or by asking questions
      about what the current docs do not
      make clear, please do so.
      
      Meanwhile, TIP 72 might provide
      additional information about Tcl's
      new 64-bit capabilities that you
      find useful
      
      http://purl.org/tcl/tip/72.html
      
      
      
    3. login: "dgp"
    4. mimetype: "text/plain"
    5. priority changed to: "3 Low"
    6. resolution changed to: "Remind"
    7. status changed to: "Open"
    8. title changed to: "improved docs for 64-bit computations"
    9. username: "dgp"
  5. Ticket change [7cb15333e9] (rid 97123) by dkf on 2003-06-25 03:25:20:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      pow() is basically an embedding of pow() from the C math
      library.  That in turn is not an integer-returning function.
       Hence neither is the Tcl version, and wrapping wide()
      around it doesn't change anything; it just bandages on a
      type-conversion afterwards.
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  6. Ticket change [5691781bd3] (rid 94346) by dkf on 2003-07-05 05:29:38:

    1. closedate changed to: "2003-07-04T22:29:38"
    2. closer changed to: "dkf"
    3. icomment:
      
      
      File Added - 54981: exprdoc.patch
      
      Logged In: YES 
      user_id=79902
      
      Tightened up the wording in expr.n as it was slightly loose
      from the PoV of people coming from other than a C/C++
      background.
      
      I attach the patch I've applied (to both the HEAD and 8.4)
      here. Henning, if you feel that the alterations it makes are
      insufficient, could you please supply more detail about how
      you feel things should be fixed?  Thanks!
      
      
    4. login: "dkf"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "dkf"
  7. Add attachment "exprdoc.patch" [a909c4e4f6] (rid 99087) by dkf on 2003-07-05 05:29:38.