You are viewing a single comment's thread. Return to all comments →
read expression Evaluate the expression using bc with scale set to 3 for three decimal places result=expression" | bc -l) Print the result using printf to ensure it's properly formatted printf "%.3f\n" $result
read expression
result=expression" | bc -l)
printf "%.3f\n" $result
Why does this not work in test case 0, but it works in all other test cases?
Seems like cookies are disabled on this browser, please enable them to open this website
Arithmetic Operations
You are viewing a single comment's thread. Return to all comments →
Why does this not work in test case 0, but it works in all other test cases?