I would like to remove the remainder from a fraction if possible. I want a function
$$f(x,y) = x/y - remainder$$
$$f(3,2) = 1$$ $$f(7,2) = 3$$ $$f(12,5) = 2$$
It seems so simple but its been bugging me for a while. Please help.
You are looking for division with remainder We have $y=\lfloor \frac yx \rfloor x+r$, where $f(x,y)=\lfloor \frac yx \rfloor, r=y-\lfloor \frac yx \rfloor x$. What do you mean by "from first principles?"
Floor function will do what you want . Floor function of the value obtained by normal divison .