Friday, June 11, 2010

How to add two floating point numbers ?

You can make you og 'bc' command to do the arithmatic operations in shell script.
Following script illustrates a sample implimentation

a 1.2
b 3.1
x=(echo $a +$b|bc)
echo $x

No comments:

Post a Comment