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.
Having the same issues as everyone else here; scale = 3 gives 17.928 NOT 17.929. Although I know that the answer should be 17.929, quite an odd problem.
EDIT:
You need to use the printf method for it to work, the reason is that -bc literally chops off the end of the number instead of actually rounding.
Cookie support is required to access HackerRank
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 →
Having the same issues as everyone else here;
scale = 3
gives 17.928 NOT 17.929. Although I know that the answer should be 17.929, quite an odd problem.EDIT:
You need to use the
printf
method for it to work, the reason is that-bc
literally chops off the end of the number instead of actually rounding.