To do math operations in Linux shell, bc language can be used. For example,
echo `echo "scale=4;sqrt(400)"|bc -l`
This will give output of 20.0000
Unfortunately bc is not available on android. My question is,
1) How do I do math operations in android shell?
2) If bc has to be used, then, how to install it in android?
It is good enough for me if I can do integer calculations, I don't really need floating point or arbitrary precision results.