Wow, sunos must've had a really old version. ksh on Slackware has //, and is getting on a bit:
(~) ksh --version
version sh (AT&T Labs Research) 1993-12-28 o+
I guess they were using ksh88?
Aside: you can also declare variables to be integers with
It's not relevant for this problem (assigning a non-number just results in 0), but it lets you do things like foo+=1 (doesn't work in bash, but ksh and zsh understand it). Of course, this increments foo by 1, so if foo is 11, it becomes 12. In contrast, if foo were a plain string, it would become 111. It also does automatic arithmetic expansion on assignment to that variable (bash does do that). Bash can do the equivalent with: let "foo+=1".
In ksh/zsh, you can also do
where N is the base. So, if N is 16, the variable will always be printed in hex.
We're getting totally off-topic now, but ksh/zsh can also do floating point arithmetic. For example, to calculate VAT, you might do
# typeset -F 2 total=$((249*1.175))
# print $total
(i.e. with -F N, the variable is always printed to N decimal places; the default is 10 if N is omitted).
Alas, bash doesn't understand floating point, so this isn't portable.