diff options
author | Kevin B Kenny <kennykb@acm.org> | 2023-01-22 02:02:37 (GMT) |
---|---|---|
committer | Kevin B Kenny <kennykb@acm.org> | 2023-01-22 02:02:37 (GMT) |
commit | 2b516939bd2d4aae1f1b2b8c561419146d99c978 (patch) | |
tree | 08bf419bd407d5ed5501422766eeaeed7b6fa17b /tests/expr.test | |
parent | 1c6b1c9e6cfa728758ecf5c6172af85ca2d3a93c (diff) | |
parent | 47b385e3dbb2e889faecefcaf7c29685b7879411 (diff) | |
download | tcl-2b516939bd2d4aae1f1b2b8c561419146d99c978.zip tcl-2b516939bd2d4aae1f1b2b8c561419146d99c978.tar.gz tcl-2b516939bd2d4aae1f1b2b8c561419146d99c978.tar.bz2 |
Merge 8.7 (Bug [e3dcab1d14])
Diffstat (limited to 'tests/expr.test')
-rw-r--r-- | tests/expr.test | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/expr.test b/tests/expr.test index 62b1c27..a20aee1 100644 --- a/tests/expr.test +++ b/tests/expr.test @@ -7450,11 +7450,52 @@ test expr-62.10 {TIP 582: comments can go inside function calls} { expr {max# comment (1,2)} } 2 + +# Bug e3dcab1d14 TODO: Need to work out a test case that fails +# without tcl_precision, which has been eliminated in 9.0 + +# proc do-one-test-expr-63 {e p float athreshold} { +# # e - power of 2 to test +# # p - tcl_precision to test wuth +# # float - floating point value 2**-$p +# # athreshold - tolerable absolute error (1/2 decimal digit in +# # least significant place plus 1/2 least significant bit) +# set trouble {} +# set ::tcl_precision $p +# set xfmt x[expr $float] +# set ::tcl_precision 0 +# set fmt [string range $xfmt 1 end] +# set aerror [expr {abs($fmt - $float)}] +# if {$aerror > $athreshold} { +# return "Result $fmt is more than $athreshold away from $float" +# } else { +# return {} +# } +# } + +# proc run-test-expr-63 {} { +# for {set e 0} {$e <= 1023} {incr e} { +# set pt [expr {floor($e*log(2)/log(10))}] +# for {set p 6} {$p <= 17} {incr p} { +# set athreshold [expr {0.5*10.0**-($pt+$p) + 2.0**-($e+53)}] +# set numer [expr {5**$e}] +# set xfloat x[expr {2.**-$e}] +# set float [string range $xfloat 1 end] +# test expr-63.$p.$e "convert 2**-$e to decimal at precision $p" { +# do-one-test-expr-63 $e $p $float $athreshold +# } {} +# } +# } +# rename do-one-test-expr-63 {} +# rename run-test-expr-63 {} +# } +# run-test-expr-63 # cleanup unset -nocomplain a unset -nocomplain min unset -nocomplain max + ::tcltest::cleanupTests return |