Artifacts Associated With Ticket 3120139fffffffff
Ticket change [265180d0e9] (rid 88323) by hobbs on 2010-11-26 23:56:14:
- assignee initialized to: "kennykb"
- cmimetype initialized to: "text/plain"
- comment initialized to:
If the locale is set up to not be LC_NUMERIC=C, Tcl_PrintDouble can give odd behavior. I am able to reproduce this by using a French regional locale (Control Panel -> Regional Locale and Settings), starting python with tkinter, where they have called locale.setlocale(locale.LC_ALL, '') but this could occur in other instances of Tcl embedded. When in this case, Tcl_PrintDouble can produce odd results: (arelle) 61 % expr 2-0.1 1,8999999999999999.0 (arelle) 62 % set tcl_precision 5 5 (arelle) 63 % expr 2-0.1 1,9.0 This is because the .0 tack-on is locale-ignorant.
- foundin initialized to: "obsolete: 8.6b1.1"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "hobbs"
- subsystem initialized to: "10. Objects"
- title initialized to: "Tcl_PrintDouble not locale-safe"
- type initialized to: "Bug"
Ticket change [ef55c33a76] (rid 108972) by kennykb on 2010-11-28 00:49:55:
- icomment:
The attached patch is a complete rewrite of TclDoubleDigits, motivated largely by performance considerations. It exploits a number of important special cases to avoid hideously expensive mp_div operations; for all numbers less than 10**26, it requires no mp_div calls, and for numbers in that range that are at least 10**-3, it requires no bignum arithmetic at all. It is well tested only on Linux-x86 -- and no attempt has been made to tweak the build system to add the two additional needed libtommath files to the MacOSX build. It should be at least vetted on Windows (and the Mac build repaired and tested) before committing. It's a big enough change that I'm a little nervous about backporting it, and I welcome advice.
- login: "kennykb"
- mimetype: "text/plain"
- username: "kennykb"
- icomment:
Add attachment "double.patch" [80c7f4ac7f] (rid 116926) by kennykb on 2010-11-28 00:50:46.
Ticket change [1acc652273] (rid 123042) by kennykb on 2010-11-28 00:50:46:
- icomment:
File Added - 394576: double.patch
- login: "kennykb"
- mimetype: "text/plain"
- username: "kennykb"
- icomment:
Ticket change [0112bd5a0b] (rid 119419) by nijtmans on 2010-11-29 04:35:14:
- icomment:
Well, I object to the NaN-tests (util-14.1 and 14.2), without a proper discussion, related to bug 3105247. The fact that those tests were missing here, implies that the formatting of funky NaN values was an oversight, and not an intended behavior. (For the numerical parser, TIP #249, I believe it was intentional but that's tested somewhere else). And those tests have no relation to this bug #3120139 Apart from that, this patch looks good. The function's name is TclDoubleDigits, but in the test cases it is refered as Tcl_DoubleDigits; Was it originally meant to be public?
- login: "nijtmans"
- mimetype: "text/plain"
- username: "nijtmans"
- icomment:
Ticket change [ab926aa644] (rid 101139) by kennykb on 2010-12-01 23:46:50:
- closedate changed to: "2010-12-01T16:46:50"
- closer changed to: "kennykb"
- resolution changed to: "Fixed"
- status changed to: "Closed"