I'm trying to assign the value 3.51 to a double, but it stores 3.5099999999...
So, i'm trying to round it, but I can't use the round function (because the teacher doesn't want it) and passed some time, those errors are critical...
The integer 351 is stored as 351. It is not stored as 350.9999999, because it is an integer.
If it appears not to work, you are doing it wrong. Do all the calculations in integers, and when it's time to output the answer, still do not convert it to floating point - output it as the integer answer in the form of a string, with a decimal point inserted in the right place.
The problem is that the objects that programmed the teacher return doubles, and I'm allways using it. I cant be casting from doubles to integers because I wast precision and time... I need to do operations with dobles such divide...