Maths Problem

Author
Discussion

ecs

Original Poster:

1,229 posts

170 months

Sunday 4th September 2016
quotequote all
Guess this is the right place for this? I need to figure out an algorithm which calculates the following:

If you’ve got a min value, a max value and a number between those values, how would you calculate the number between max and min as a percentage?

e.g. if min=-100, max=100 and n=0, n as a percentage should be 50%

Min and max can be positive or negative values and I guess it ought to be possible for min to be greater than max if it doesn't make things even more complicated.

I'm a bit out of my comfort zone on this one, so does anyone here know how to solve this?