Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: d9a082453b59080874f0de5d52ec54886aad88b3
Ticket: 758488ffffffffffffffffffffffffffffffffff
improved docs for 64-bit computations
User & Date: dgp on 2003-06-23 01:32:01
Changes

  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"