1

I could calculate the percentage of a value from a total set right from the top of my head. This includes large numbers like for example; finding the percentage of 1040 from 75000 = 1.377%, 344 from 5400 = 6.37% and so on...

But most times when I come across scenarios to apply such calculations on code I find myself googling for formulas and then I wonder; how am I able to come to a valid result when faced with similar challenge but could not recall or tell the formula my funny brain is deriving it's results from.

Maybe my brain isn't even using a formula. :/
So I guess because from pondering on how I arrived at results, I could tell I'm starting from an "if"...
Like:

If 25 of 100 = 25%
and 45 of 250 = 18%
Then 450 of 2400 will equal 18.7...%

Ask me what formula was used in the first "if" condition and I can't tell because that's common sense for me.

Comments
  • 0
    Brain is a peculiar motherfucker.
  • 0
    It's basic math. Here is the thingy to make it easy to implement

    A === B
    C === D.

    Now place X ANY where and the rule is : Multiply not diagonaly oposing numbers and dived by diagonaly oposed. I hope it makes it cleasr :

    X == B
    C == D

    X = C*B/D

    A == B
    X == D

    X = A*D /B

    Edit. The whole machine learning works on that simple rule lol
Add Comment