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.
because ceil needs a floating point number and if you use 2 then 2*area/base will return an integer which will ignore decimal places.
while 2.0*area/base will return a floating point number which is then handled by ceil.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Minimum Height Triangle
You are viewing a single comment's thread. Return to all comments →
because ceil needs a floating point number and if you use 2 then 2*area/base will return an integer which will ignore decimal places. while 2.0*area/base will return a floating point number which is then handled by ceil.