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
|
227 Discussions
|
Please Login in order to post a comment
i'm not going to give too much away, but i'll say that the tutorial ironically invokes an error of precision (semantic precision at least) by saying that the
scale
variable in bc rounds. it just truncates the digits. there's a big difference for the sake of getting the first test case correct.read input printf "%.3f\n"
echo "$input" | bc -l
Can anyone explain this answer?
Why does this not work in test case 0, but it works in all other test cases?
why could
bc
be used? it's not even installed on my system and it has bash note: i have coreutils on a linux system