Your problem is that you are doing integer maths.
mr = (130-20)/(1023-205)
mr = 110/818
Which normally equates to:
mr = 0.135
But since all those numbers are integers the result is an integer, and is truncated at the decimal point, which means that mr is assigned:
mr = 0
You can force floating point maths by either including a decimal ...