Associate
- Joined
- 6 Nov 2006
- Posts
- 722
- Location
- Devon
I have a script file which contains the following:
Now this code doesn't work and from some googling it seems that the bash shell doesn't support floating point arithmetic. I tried using dtksh but the script file won't run at all then; it just says command not found. What's the best way to get this simple floating point arithmetic working?
Thanks
Code:
START=-0.0004078266210854053
END=0.001179981511086226
DIFF=$(($END - $START))
for i in $(seq -w 0 10)
j=$(($START +$DIFF\*$i/10))
./eqlat.out $j > dump${i}
done
Now this code doesn't work and from some googling it seems that the bash shell doesn't support floating point arithmetic. I tried using dtksh but the script file won't run at all then; it just says command not found. What's the best way to get this simple floating point arithmetic working?
Thanks