coolcamo8642

05-08-2008, 01:46 AM

I'm currently using the following function to find $a based on $L:

function XP($L) {

$a=0;

for($x=1; $x<$L; $x++) {

$a += floor($x+300*pow(2, ($x/7)));

}

return floor($a/4);

}

What I would like to do is find L based on a. For example, $a = 83 when $L = 2 and $a = 174 when $L = 3. I would like to instead input a value anywhere from 83-173 and have 2 returned.

Any suggestions would be greatly appreciated.

function XP($L) {

$a=0;

for($x=1; $x<$L; $x++) {

$a += floor($x+300*pow(2, ($x/7)));

}

return floor($a/4);

}

What I would like to do is find L based on a. For example, $a = 83 when $L = 2 and $a = 174 when $L = 3. I would like to instead input a value anywhere from 83-173 and have 2 returned.

Any suggestions would be greatly appreciated.