View Single Post
eyal282
Veteran Member
Join Date: Aug 2011
Old 02-04-2019 , 11:23   Re: Solve Exponential Base
Reply With Quote #7

Quote:
Originally Posted by stickz View Post
I have the following code now.
Code:
void WriteConsoleSkillValues(int client, float mult)
{
	for (int base = 1; base <= 10; base++)
	{
		float value = Pow(float(base), 1.0 / mult) * 100.0;
		PrintToConsole(client, "Round: %d% ^ %.2f = %d", RoundToNearest(value), mult, base);
	}
}
Which produces the following output.
Code:
--> Low Uneven Skill Percent Difference <--
Round: 100 ^ 1.75 = 1
Round: 149 ^ 1.75 = 2
Round: 187 ^ 1.75 = 3
Round: 221 ^ 1.75 = 4
Round: 251 ^ 1.75 = 5
Round: 278 ^ 1.75 = 6
Round: 304 ^ 1.75 = 7
Round: 328 ^ 1.75 = 8
Round: 351 ^ 1.75 = 9
Round: 373 ^ 1.75 = 10

--> High Uneven Skill Percent Difference <--
Round: 100 ^ 1.89 = 1
Round: 144 ^ 1.89 = 2
Round: 178 ^ 1.89 = 3
Round: 207 ^ 1.89 = 4
Round: 233 ^ 1.89 = 5
Round: 257 ^ 1.89 = 6
Round: 278 ^ 1.89 = 7
Round: 299 ^ 1.89 = 8
Round: 318 ^ 1.89 = 9
Round: 336 ^ 1.89 = 10

--> Even Skill Percent Difference <--
Round: 100 ^ 1.39 = 1
Round: 164 ^ 1.39 = 2
Round: 219 ^ 1.39 = 3
Round: 269 ^ 1.39 = 4
Round: 316 ^ 1.39 = 5
Round: 360 ^ 1.39 = 6
Round: 401 ^ 1.39 = 7
Round: 442 ^ 1.39 = 8
Round: 480 ^ 1.39 = 9
Round: 518 ^ 1.39 = 10
However, it's not precise enough. Is there any way I can make this more precise? The equation is evaluating as if 1.39 and 1.89 are sent, but the values actually being sent are 1.40 and 1.90.
Maybe use %.2f instead of %d ( you don't round %.2f ) but I know that floats cannot represent exact values.
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline