Skip to content
Tcl Source Code History Of Ticket 218430
Login

History Of Ticket 218430

Artifacts Associated With Ticket 218430

  1. Ticket change [9e94d53f56] (rid 96501) by nobody on 2000-10-26 00:57:31:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      OriginalBugID: 6011 Bug
      Version: 8.3.1
      SubmitDate: '2000-07-14'
      LastModified: '2000-07-17'
      Severity: SER
      Status: Closed
      Submitter: techsupp
      ChangedBy: ericm
      OS: All
      OSVersion: AIX Mac WIn98 SuSE Linux 6.4
      FixedDate: '2000-10-25'
      ClosedDate: '2000-07-17'
      
      
      Name:
      Alexander Schoepe
      
      CustomShell:
      no
      
      ReproducibleScript:
      expr int(19.49 * 100) % 10
      
      DesiredBehavior:
      result should be 9 but expr returns with 8
      
      
      
      As has been discussed on comp.lang.tcl, this is really a "feature" of how floating-point numbers are represented on a particular platform.  As Don Porter said:
      
      The Jedi seeks not exact results from floating point operations.
      
      % expr int(19.49 * 100) % 10
      8
      % expr int(19.49 * 100)
      1948
      % expr 19.49 * 100
      1949.0
      % set tcl_precision 17
      17
      % expr 19.49 * 100
      1948.9999999999998
      
      Every programmer eventually learns this lesson, but it's not a
      bug, nor a difficulty specific to Tcl.
      
      ---
         Eric Melski                            The Other Tcl Guy
         ericm at ajubasolutions.com            Ajuba Solutions
      
      -- 07/17/2000 ericm
      
      
      
    4. foundin initialized to: "obsolete: 8.3.1"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "nobody"
    9. subsystem initialized to: "69. Other"
    10. title initialized to: "error in expr"
    11. type initialized to: "Bug"
  2. Ticket change [4801ba48e9] (rid 99811) by welch on 2000-10-26 08:22:15:

    1. closedate changed to: "2000-10-26T01:22:15"
    2. closer changed to: "welch"
    3. priority changed to: "2"
    4. resolution changed to: "Fixed"
    5. status changed to: "Closed"
  3. Ticket change [a99a394e34] (rid 99176) by dgp on 2001-04-20 02:29:13:

    1. closedate changed to: "2001-04-19T19:29:13"
    2. closer changed to: "dgp"
    3. subsystem changed to: "16. Commands A-H"