+ 1
What am I doing wrong on âHalloween Candyâ activity?
https://code.sololearn.com/cVZoH50bKnI0/?ref=app My code wonât round up correctly!
1 Answer
+ 2
You are using type conversion to int - not rounding.
If you int a floating point number, only the decimals are cut off. Basically you round towards zero.
For proper rounding - and ceiling and flooring - include cmath and use the specific functions from there.