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.
that's kind of overkill; it forces 50 significant figures regardless of where the decimal point is. So 1.0 would display as 1.0000000000000000000000000000000000000000000000000.
with std::fixed, it makes std::setprecision(5) always require exactly 5 digits after the decimal point, which matches the statement of the problem, which requires a tolerance of 0.0001.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Sherlock and Moving Tiles
You are viewing a single comment's thread. Return to all comments →
that's kind of overkill; it forces 50 significant figures regardless of where the decimal point is. So 1.0 would display as 1.0000000000000000000000000000000000000000000000000.
with std::fixed, it makes std::setprecision(5) always require exactly 5 digits after the decimal point, which matches the statement of the problem, which requires a tolerance of 0.0001.