I'm using python 3.5.
So I'm trying to create a function that takes x and y as positive float input, and then computes and returns R = x - N * y, where N is the largest integer, so that x > N * y.
I made this function:
N = 1
while x <= N * y:
R = x - N * y
N = N+1
R is defined inside the
while loop. If the condition of the
while loop is not true initially, its body never executes and
R is never defined. Then it is an error to try to
To solve the problem, initialize
R to something before entering the loop.