0

I'm working with some code that calculates point values based on computer hardware.

On one computer as an example, the computer ends up with 29 possible points.

Now lets say that I run the same code on another computer, and it tries to match hardware to the previously entered information from the computer with 29 points.

Say this computers hardware points match 7 points of the previously entered data.

Thus effectively, this computer is a ~24% match to the previously entered hardware data. (7/29)

Now, what I want to do is expand this fraction (7/29) so that the maximum amount of points is 100, but I am having trouble coming up with a formula for this that works no matter what the max points for the computer are. (Some computers can have more or less maximum points)

So basically I want to expand the fraction to x/100 from 7/29

I'm not really sure if this is possible or not, but I want to do this to allow it to be easier to understand on the surface of the software I am using, so that every computer has a maximum of 100 points based on whatever the original points are.

  • Are you trying to give computers scores? Then the percentage matches should suffice. As you said $7/29 \approx 24% = 24/100$ – Guy May 25 '17 at 20:18
  • @Sabyasachi Yes I am scoring the similarities between computers. The thing is, I don't want to display it as a percentage, I want to display it as points out of 100. – GrumpyCrouton May 25 '17 at 20:19
  • 1
    If your original fraction is $\frac{a}{b}$, then you can write it as $\frac{100a/b}{100}$. So $\frac{7}{29}$ can be written as $\frac{100\cdot7/29}{100}\approx\frac{24.1279}{100}$. Of course, most of the time the numerator will not be an integer. – MPW May 25 '17 at 20:20
  • 1
    24% is the same as 24 points out of 100. So just drop the percentage sign? – Guy May 25 '17 at 20:20
  • @Sabyasachi Ah that is so obvious to me now, thank you – GrumpyCrouton May 25 '17 at 20:38

0 Answers0