The bytecode compiler breaks on the following snippet:
proc DoPrecision {} { puts "A $::tcl_precision [expr { 1.1 + 2.2 }]"
if {[catch { incr ::tcl_precision }]} { return }
puts "B $::tcl_precision [expr { 1.1 + 2.2 }]"
DoPrecision
}
DoPrecision
Example result:
A 0 3.3000000000000003
B 1 3.0
A 1 3.3000000000000003
B 2 3.0
A 2 3.3000000000000003
B 3 3.0
A 3 3.3000000000000003
B 4 3.0
A 4 3.3000000000000003
B 5 3.0
A 5 3.3000000000000003
B 6 3.0
A 6 3.3000000000000003
B 7 3.0
A 7 3.3000000000000003
B 8 3.0
A 8 3.3000000000000003
B 9 3.0
A 9 3.3000000000000003
B 10 3.0
A 10 3.3000000000000003
B 11 3.0
A 11 3.3000000000000003
B 12 3.0
A 12 3.3000000000000003
B 13 3.0
A 13 3.3000000000000003
B 14 3.0
A 14 3.3000000000000003
B 15 3.0
A 15 3.3000000000000003
B 16 3.0
A 16 3.3000000000000003
B 17 3.0
A 17 3.3000000000000003
Don Porter
47. Bytecode Compiler
obsolete: 8.5.7
Public
|
Date: 2009-09-15 19:35 And that result is technically correct in IEEE math, which is what Tcl is |
|
Date: 2009-09-15 19:32 tcl_precision doesn't have to be touched for this unexpected result to |
|
Date: 2009-09-15 19:26
|
|
Date: 2009-09-15 17:38
|
|
Date: 2009-09-15 17:34
|
| Field | Old Value | Date | By |
|---|---|---|---|
| priority | 5 | 2009-09-15 19:26 | dgp |
| assigned_to | msofer | 2009-09-15 17:34 | dgp |
| summary | Bytecode Compiler& tcl_precision | 2009-09-15 02:16 | pixelz |