Overview
| Artifact ID: | 9e94d53f56954d2da201d272ff4bc4dea921d3a9 |
|---|---|
| Ticket: | 218430ffffffffffffffffffffffffffffffffff
error in expr |
| User & Date: | nobody on 2000-10-26 00:57:31 |
Changes
- assignee changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed 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
- foundin changed to: "obsolete: 8.3.1"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "nobody"
- subsystem changed to: "69. Other"
- title changed to: "error in expr"
- type changed to: "Bug"