We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Linux Shell
- Bash
- Arithmetic Operations
- Discussions
Arithmetic Operations
Arithmetic Operations
Sort by
recency
|
223 Discussions
|
Please Login in order to post a comment
why could
bc
be used? it's not even installed on my system and it has bash note: i have coreutils on a linux systemread user_input printf "%.3f" user_input")
read X result=X" | bc) printf "%.3f\n" $result
I ended up having to do
but I think I should have had the correct answer with just scale=3 and echoing $result without using printf. I wonder why?