Try using a double for the vars two and three instead of an int. Should work I think.
Seems three/two is seen as an integer and rounded down?