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
|
249 Discussions
|
Please Login in order to post a comment
!/bin/bash
read a result=a"|bc -l) echo $result | xargs printf '%.3f\n'
!/bin/bash
read -r expr
value=expr" | bc -l)
printf "%.3f\n" "$value"
read exprr; echo " scale = 3; $exprr " | bc -l
I wrote this, but only testcase is failing my output is 17.928 expcted output is 17.929
Can anyone help me with this?
read x
result=x" | bc -l | xargs printf '%.3f')
echo "$result"