Hi Guys,

I’m a bit frustrated about results I’m getting while doing lab at the end of chapter 5

Could someone guide me why m/10 vs m*0.1 is not equivalent?

Steps to reporoduce:

```
def get_y(m, b, x):
y = m*x + b
return y
def calculate_error(m, b, point):
x_point, y_point = point
y = m*x_point + b
distance = abs(y - y_point)
return distance
def calculate_all_error(m, b, points):
total_error = 0
for point in datapoints:
point_error = calculate_error(m, b, point)
total_error += point_error
return total_error
datapoints = [(1, 2), (2, 0), (3, 4), (4, 4), (5, 3)]
possible_ms = [m*0.1 for m in range(-100,101,1)]
possible_bs = [b*0.1 for b in range(-200,201,1)]
error = 0
best_m = 0
best_b = 0
smallest_error = (float("inf"))
for m in possible_ms:
for b in possible_bs:
error = calculate_all_error(m,b,datapoints)
if error < smallest_error:
smallest_error = error
best_m = m
best_b = b
print(best_m,best_b,smallest_error)
"""
possible_ms = [m/10 for m in range(-100,101,1)]
possible_bs = [b/10 for b in range(-200,201,1)]
0.4 1.6 5.0
possible_ms = [m*0.1 for m in range(-100,101,1)]
possible_bs = [b*0.1 for b in range(-200,201,1)]
0.30000000000000004 1.7000000000000002 4.999999999999999
"""
```