Artifacts Associated With Ticket 532537ffffffffffffffffffffffffffffffffff
Ticket change [158b1677bf] (rid 124579) by nobody on 2002-03-20 16:03:35:
- assignee initialized to: "hobbs"
- cmimetype initialized to: "text/plain"
- comment initialized to:
Try following script under Window NT: proc testDouble {} { set a0 [expr {double(2.63624325102e-308)}] set b [expr {double(0.19024736769)}] set a $a0 set count 30 while {[incr count -1] > 0} { # just make a lose its double repr # string length $a puts "a = $a" set a [expr {$a*$b}] } } a is decreasing until 0.0. Now uncomment the [string length] line, and try it again. This gives the error message: can't use non-numeric string as operand of "*" (Is it possible to have "floating-point value too small to represent" ?) This work fine under Linux. Can I conclude that my Windows NT strtod() is buggy ? - foundin initialized to: "None"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "11. Conversions from String"
- title initialized to: "Buggy Windows strtod() ?"
- type initialized to: "Bug"
Ticket change [fb3f308700] (rid 92021) by hobbs on 2002-03-23 07:09:12:
- closedate changed to: "2002-03-23T00:09:12"
- closer changed to: "hobbs"
- icomment:
Logged In: YES user_id=72656 perhaps ... but I get the following on Win2K with a VC++6 compiled 8.3.4 (ActiveTcl 8.3.4.2): (tkcon) 50 % testDouble a = 2.63624325102e-308 a = 5.01538339097e-309 a = 9.54163488088e-310 a = 1.81527091955e-310 a = 3.45350514088e-311 a = 6.57020262356e-312 a = 1.24996375432e-312 a = 2.37802313969e-313 a = 4.52412642615e-314 a = 8.60703143633e-315 a = 1.63746507553e-315 a = 3.1152341918e-316 a = 5.92665091618e-317 a = 1.12752993739e-317 a = 2.14509469586e-318 a = 4.08098223465e-319 a = 7.76374755875e-320 a = 1.47725628107e-320 a = 2.81123352484e-321 a = 5.33590897509e-322 a = 1.03753785627e-322 a = 1.97626258336e-323 a = 4.94065645841e-324 a = 0.0 a = 0.0 a = 0.0 a = 0.0 a = 0.0 a = 0.0
- login: "hobbs"
- mimetype: "text/plain"
- status changed to: "Pending"
- username: "hobbs"
Ticket change [378f268af7] (rid 107302) by beric on 2002-03-25 15:16:29:
- icomment:
Logged In: YES user_id=493507 Have you uncommented the [string length] line ? % expr {double(4.94065645841e-324)} floating-point value too small to represent % expr {double(5.92665091618e-317)} floating-point value too small to represent with both AS 8.3.4.1 and 8.4a4 compiled with VC6 on two NT 4 station. - login: "beric"
- mimetype: "text/plain"
- username: "beric"
- icomment:
Ticket change [5a953a357a] (rid 118168) by dkf on 2002-03-25 17:51:20:
- icomment:
Logged In: YES user_id=79902 Can duplicate this in 8.3.4 under Solaris/SPARC as long as I remember to uncomment the [string length] (which acts as a complete destroyer of the double rep, as it converts to the wide-character internal rep)
- login: "dkf"
- mimetype: "text/plain"
- status changed to: "Open"
- username: "dkf"
- icomment:
Ticket change [d232206deb] (rid 113489) by beric on 2002-03-25 20:09:07:
- icomment:
Logged In: YES user_id=493507 Being surprised to found in <float.h> #define DBL_MIN 2.2250738585072014e-308 I have tried a c code declaring two double: 2.63624325102e-308 5.01538339097e-309 It compile on both windows and linux, linux strtod() works with both string repr, windows (VC6) fails with errno == ERANGE for the second. The following page show that doubles have normalized and denormalized representation: http://babbage.cs.qc.edu/courses/cs341/IEEE- 754references.html DBL_MIN is the minimum normalized double. It looks like windows's strtod() doesn't work on denormalized double, whereas linux does.
- login: "beric"
- mimetype: "text/plain"
- username: "beric"
- icomment:
Ticket change [81069b7fef] (rid 116965) by dgp on 2003-11-13 08:53:17:
- foundin changed to: "obsolete: 8.3.4"
Ticket change [dca0fc4363] (rid 114516) by kennykb on 2005-01-25 22:20:42:
- assignee changed to: "kennykb"
- icomment:
Logged In: YES user_id=99768 This problem is in the scope of TIP #132 - assigning it to myself. The fix may be as simple as including strtod.obj in COMPAT_OBJS, depending on whether compat/strtod.c has the same bug. But depending on the native C library in this area has proven to be a mistake; FP conversion bugs have been recurrent.
- login: "kennykb"
- mimetype: "text/plain"
- username: "kennykb"
Ticket change [61909bd2e6] (rid 92262) by kennykb on 2005-01-25 23:03:32:
- icomment:
Logged In: YES user_id=99768 Nope, compat/strtod.c doesn't do denormals either - and it fails silently, which is worse. % expr 2e-308 1.9999999999999998e-308 % expr 2.63624325102e-308 0.0 So we'll need to bite the bullet, fix this in compat/, and promote the fix to generic/. I did *not* need to hear this, but I'm not really surprised.
- login: "kennykb"
- mimetype: "text/plain"
- username: "kennykb"
- icomment:
Ticket change [b02b9d00b6] (rid 97937) by kennykb on 2005-05-11 02:07:17:
- status changed to: "Closed"
Ticket change [df786ea60b] (rid 115021) by kennykb on 2005-05-11 02:07:18:
- icomment:
Logged In: YES user_id=99768 The changes that implement TIP #132 fix this problem as a side effect, so I'm going to close this out as "fixed in 8.5". An 8.4 backport is probably not worth the effort.
- login: "kennykb"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- username: "kennykb"
- icomment:
Ticket change [1d7a8db2cd] (rid 90820) by kennykb on 2005-05-11 02:07:19:
- closedate changed to: "2005-05-10T19:07:19"
- closer changed to: "kennykb"