diff options
author | Steve Bennett <steveb@workware.net.au> | 2010-01-24 12:05:36 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2010-10-15 11:02:44 +1000 |
commit | a7335808c5725934d81dbe68247b62a6ab08bf2f (patch) | |
tree | de45f62dacf49ebabc9b89a441b6d8c3e8f14256 /bench.tcl | |
parent | a17425e476861fde1e1ad824181f97e081740659 (diff) | |
download | jimtcl-a7335808c5725934d81dbe68247b62a6ab08bf2f.zip jimtcl-a7335808c5725934d81dbe68247b62a6ab08bf2f.tar.gz jimtcl-a7335808c5725934d81dbe68247b62a6ab08bf2f.tar.bz2 |
More expr tests and fixes
*: Add tests/expr-new.test from Tcl
*: Directly convert from int to double if possible
*: Always treat '-' in front of a number as unary minus
so that '-0x1234' works.
*: Fix expr when the variable does not exist
*: Add optional support for math functions
*: Also double/0 == Inf or -Inf
Diffstat (limited to 'bench.tcl')
-rw-r--r-- | bench.tcl | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -160,6 +160,16 @@ proc ary n { } } +proc ary_dict n { + for {set i 0} {$i < $n} {incr i} { + dict set x $i $i + } + set last [expr {$n - 1}] + for {set j $last} {$j >= 0} {incr j -1} { + dict set y $j $x($j) + } +} + ### REPEAT ##################################################################### proc repeat {n body} { @@ -548,6 +558,7 @@ bench {heapsort} {heapsort_main} bench {sieve} {sieve 10} bench {sieve [dict]} {sieve_dict 10} bench {ary} {ary 100000} +bench {ary [dict]} {ary_dict 100000} bench {repeat} {use_repeat} bench {upvar} {upvartest} bench {nested loops} {nestedloops} |