When I do this:
::counter::init h -hist 10
::counter::count h 9.1
::counter::count h -9.2
I end up with bin 0 incremented twice. I should have
incremented bin -1 once and bin 0 once.
proc ::counter::count is incorrect. This fixes
(counter.tcl) that problem.
-hist {
upvar #0 counter::H-$tag histogram
set bucket [expr int([expr floor([expr {$delta /
$counter(bucketsize)}])])]
if {![info exists histogram($bucket)]} {
set histogram($bucket) 0
}
incr histogram($bucket)
The problem is that int(-0.9) == 0 and int(0.9) == 0
The html output is also incorrect as the labels are off
by one. I simply subtracted one in proc
histHtmlDisplayBarChart
#set x [expr {$i * $counter(bucketsize) *
$counter(mult)}]
set x [expr {($i-1) * $counter(bucketsize) *
$counter(mult)}]
There are still problems with the -skip option
|