Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I would like to remove the remainder from a fraction if possible. I want a function

$$f(x,y) = x/y - remainder$$

for example

$$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.

share|improve this question
1  
What properties do you want this remainder to have? Do you want it to be an integer? Because it seems to me like you're looking at standard integer division. –  Patrick Da Silva Jun 14 '13 at 12:32
    
Do you mean something like en.wikipedia.org/wiki/Floor_and_ceiling_functions? –  Amzoti Jun 14 '13 at 12:33
    
x and y are both integers. The output of f(x,y) is also an integer. Yes I need something like a floor function but I want it from first principles if possible –  Manatok Jun 14 '13 at 12:37
add comment

2 Answers

up vote 1 down vote accepted

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?"

share|improve this answer
    
I want to define floor from first principles if possible. So knowing what x and y are, using basic arithmetic determine what the remainder is. –  Manatok Jun 14 '13 at 13:12
add comment

Floor function will do what you want . Floor function of the value obtained by normal divison .

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.