Artifacts Associated With Ticket 218430
Ticket change [9e94d53f56] (rid 96501) by nobody on 2000-10-26 00:57:31:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- 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
- foundin initialized to: "obsolete: 8.3.1"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "69. Other"
- title initialized to: "error in expr"
- type initialized to: "Bug"
Ticket change [4801ba48e9] (rid 99811) by welch on 2000-10-26 08:22:15:
- closedate changed to: "2000-10-26T01:22:15"
- closer changed to: "welch"
- priority changed to: "2"
- resolution changed to: "Fixed"
- status changed to: "Closed"
Ticket change [a99a394e34] (rid 99176) by dgp on 2001-04-20 02:29:13:
- closedate changed to: "2001-04-19T19:29:13"
- closer changed to: "dgp"
- subsystem changed to: "16. Commands A-H"