is it not possible to simply di aritmetic without using bc or awk
i have tried folllowing operatrions but they support only integer types plz suggest me code for floating using values stored in the variables.the ans i get is integer and if i input floating values i get error numeric constant missing plz help
Depending on the fractional resolution you require you can scale up all the numbers and use the fixed-point arithmetics. Other than this - it's not possible to have FP in shell as FP instructions are not a must-have for a Unix system machine and shells should be as portable as possible. For same reason i.e. Linux kernel does not have any floating point operation as well.
frans:
Below script:
echo "1 / 2" | bc -l
is a valid shell script performing FP arithmetics. But I know what you meant.