Math.Ceiling Problem with a challange
It has passed all the cases but two (Case 2, Case 5) In Case 2 the inputs are: 6 and 3 Isn't Math.Ceiling supposed to round 3.6 up to 4? Why isn't it working like that here? https://code.sololearn.com/cLNfNzXP3ERR/?ref=app
Your problem isn't with ceil, but a little problem having to do with type casting and how types interact within expressions. When you divide an integer by an integer, your result, remainder or no, will be an int, with the fractional portion truncated. This means that the fractional part of your number will be discarded. For example, 3/2 would normally be 1.5, however we leave off the fractional part for a result of 1. To fix this, you need either the numerator or the denominator to be a double type, otherwise this will continue to happen. Using (double)door/duct or door/(double)duct would suffice. This will stop the truncation because one of the types will become a double, and a int-double expression will result in a double.
BootInk Thanks a lot for real. I have completed the C# course but I dont remember such a thing as putting (double) or any other type there in lessons.. Either I missed or the lessons don't include the info. Thank you really much! Appreciated.
Bug: Sololearn notification is still showing number in the notification icon even i did mark as read
Izzy the iguana code coach
Finished python for beginners
Hi, hope you're doing good.Could someone please tell me why does the while loop not stop when I type in rock, paper or scissors?
C++ Question re stringstream
Why sometimes 0 is printed?