Why do I see a difference in the results for the following code:
read a printf "%.3f\n" $(bc -l <<< "$a")
RESULT: 17.929 and
read a echo "scale=3; $a" | bc -l
My input expression is 5+50*3/20 + (19*2)/7.
They seem to be doing the same thing, but the end result is different. Why?
What change(making use of echo) can I make in the second snippet above to get the same result as the first snippet?