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
|
242 Discussions
|
Please Login in order to post a comment
read -r exp awk "BEGIN { printf \"%.3f\n\", $exp }"
read -r expression
evaluation={expression}" | bc)
printf '%.*f\n' 3 "$evaluation"
read exp
result=exp" | bc -l)
printf "%.3f\n" "$result"
Just another way using here strings "<<<"
read expression result=expression") printf "%.3f\n" "$result"