Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 2f01ab645c32ae07bb577ba620ceec215f9eb0e7900eb12b309cc82b031a6c4f
Ticket: e5f06285ded599f7fbb9951374b54867eeeb6508
lseq : inconsistent rounding
User & Date: oehhar on 2023-04-25 09:35:27
Changes

  1. icomment:
    Thanks for the comment.
    Thanks to Brian to take it and work on it: check-in: [62eaef043c] , branch: [bug-fa00fbbbabe].
    
    Here are my perhaps unrelated comments:
    
    Displaying of a double in decimal is difficult and may have the effects seen here. This might be intentional, as it might be more exact on the double level.
    
    So, lets try manually with TCL 8.6.13:
    
    % expr {4 + 22 * 0.1}
    6.2
    % expr {4 + 23 * 0.1}
    6.300000000000001
    % expr {4 + 24 * 0.1}
    6.4
    
    So, the calculation is ok. Only the displayed numbers are "ugly" or "surprising", but this is due to the display as decimal of the double data type.
    
    I would at least think twice, if changing this on the display side is an improvement. 6.3 is not equal to 6.300000000000001
    
    So, the result of expr {4 + 23 * 0.1} will not be any more equal to the lseq element.
    
    Harald
    
  2. login: "oehhar"
  3. mimetype: "text/x-fossil-wiki"
  4. username: "oehhar"