You are viewing a single comment's thread. Return to all comments →
Use a bc scale that's higher than printf's. e.g. Use scale=4 together with printf "%.3f". Only then you'll get hackerrank's expected result.
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 →
Use a bc scale that's higher than printf's. e.g. Use scale=4 together with printf "%.3f". Only then you'll get hackerrank's expected result.