Second paragraph in deS msg explains it
all your calculations are done in integer, and then assigned to float. By the time assigment is done, buffer overflow alreqady happened.
Make "m" float (or, better, double)
--
"There's nothing more nervous than a million dollars. It does not speak French, it does not speak English, it does not speak German and it moves very fast."
-- Jean Chretien