I ran into problem in TCL. I can add and multiply two integer variables. This works just fine:
set hdsuc [expr {$hdsuccess * $hdcount}]
set hdsuc [expr {$hdsuccess + $hdcount}]
But, for some reason, I am not able to divide them. Following does not work at all:
set hdsuc [expr {$hdsuccess / $hdcount}]
The above returns 0. Could there some issue with the settings?
It's doing integer division. You need to convert one of the arguments to a double. e.g.:
set hdsuc [expr {double($hdsuccess) / $hdcount}]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With