Hi, i have mathematical problem which I'm unable to convert to PHP or explain differently. Can somebody send my in the right direction?
I have two number which are in order (sequence). #1
and #2
. I want to somehow compare those two numbers and get a positive number lower than 100
as the result of the comparison. The higher the values, the higher the result should be. However, if #2
is also high, then the result should be "dimmed" accordingly...
These are the "expected results":
#1: 5 #2: 10 => ~ 5
#2: 10 #2: 5 => ~ 8
#1: 50 #2: 60 => ~ 12
#1: 50 #2: 100 => ~ 8
#1: 100 #2: 50 => ~ 20
#1: 500 #2: 500 => ~ 25
#1: 500 #2: 100 => ~ 50
#1: 100 #2: 500 => ~ 15
The number (1
or 2
) values are ranged between 0
and 1000
. The results are just estimates, they will obviously be different. I just want to show how it is related.