Tell me more ×
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'm not much of a maths genius here, so I was hoping you could help me out. I'm currently developing an algorithm for a javascript calculator that has two variables- both with a minimum and a maximum value, both of which can change based on user-input;

X can be -1 to 1.8 while Y can be -1.05 to 1.25

So max = 1.8 / 1.25 and min = -1 / -1.05

Calculating the minimum value possible with both min values gets- 0.95 while the maximum possible of both values gets- 1.44

Logically, in my mind anyway, I would have concluded that any values either variable gets in between their minimum and maximum values would be between those two limits... however with input like- 1.6/0.05, you get 32.

Can somebody give me a rough explanation and maybe guide me in the right direction to getting a linear algorithm that only gives a value back between those two max and min values?

Thank you in advance!

share|improve this question
1  
If the range of the divisor, $Y$, contains zero, you can make the quotient as large as you like by making $Y$ very close to $0$. For example, take $X = 1$ and $Y = 0.000001$, then $X/Y = 100000$. So there are no possible bounds you can put on the result of the division. – Rahul Narain Jun 5 '12 at 5:09
"getting a linear algorithm that only gives a value back between those two max and min values" What does this collection of mathematical-sounding words mean? What do you mean by a "linear algorithm"? Which "two max and min values" are you talking about? Anyway, you might ponder a simpler example: if x is between 1 and 2 and so is y then the ratio of the maxima and the ratio of the minima are both 1, but clearly the ratio $x/y$ can be bigger than or smaller than 1. What would you like to see in that simple situation? Then we can work out what to do in general. – Gerry Myerson Jun 5 '12 at 5:16

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.