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.
min = 0
max = 100
v = 50

Given those values, I can calculate the percentage of "completion" for v within the range [min,max] like this:

(100.0 / max) * v

And I get 50% - the desired value.

As you can see, I don't even use the min variable. So I have problems when this happens:

min = -100
max = 100
v = -50

I would expect the above values to produce 25%. But clearly, my earlier formula can't do that.

What can I do to calculate such values then? What changes are necessary?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

The length of the interval $[min,max]$ is $$max-min=100-(-100)=100+100=200$$

The length of the interval $[min,v]$ is $$v-min=(-50)-(-100)=-50+100=50$$

So the completion for $v$ is $$\frac{50}{200}=25\%$$

Note that in your first case $min$ was $0$ so $\frac{v-min}{max-min}\cdot100$ equaled $\frac{v}{max}\cdot100=\frac{100}{max}\cdot v$ so your formula worked in this case because $min$ equaled $0$ and did not work in the second case because $min$ did not equal $0$ .

share|improve this answer
    
Works. Thank you. –  Zol Tun Kul Sep 25 '12 at 1:39

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.