Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2001-04-14
03:27 • Ticket [218512ffff] "format" does not handle floating point numbers co... artifact: 71f6942bba user: dgp
2000-10-26
08:23 • Closed ticket [218512ffff]. artifact: e54c98c817 user: welch
01:01 • New ticket [218512ffff]. artifact: 5e8b7ff76b user: nobody

"format" does not handle floating point numbers consistently

Closed / Fixed218512ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 01:01:30
OriginalBugID: 788 Bug
Version: 8.0
SubmitDate: '1998-11-02'
LastModified: '1999-09-15'
Severity: LOW
Status: Released
Submitter: stanton
ChangedBy: hobbs
RelatedBugIDs: 916
OS: All
OSVersion: NA
Machine: NA
FixedDate: '1999-09-15'
FixedInVersion: 8.1.1
ClosedDate: '2000-10-25'


There are a number of tests in the Tcl test suite that are flagged as "eformat" to indicate that they will fail on Windows under Visual C++ (there are several in format.test).  These failures are due to a questionable implementation of sprintf by Microsoft.  In particular %g behaves badly if the leading digit is a zero (it displays too many significant digits), and %e %f %g all display too many digits for small exponent values.



The only real solution is to have our own implementation of sprintf, but it is hard to write a portable floating point implementation.
--
id 916 has a fix for MSVC, but it is not really a problem serious
enough to worry about. 
-- 08/14/1999 hobbs
welch Closed ticket [218512ffff]. [History diff]2000-10-26 08:23:19
dgp Ticket [218512ffff]: 4 changes [History diff]2001-04-14 03:27:39
Log in (anonymous is fine) to add a comment.