Raised This Month: $32 Target: $400
 8% 

Solve Exponential Base


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
stickz
Senior Member
Join Date: Oct 2012
Location: Ontario, Canada
Old 02-03-2019 , 20:32   Solve Exponential Base
Reply With Quote #1

I created an sm_botpow command to output how many bots my exponential equations add.

It currently produces the following output. The base is sometimes multiplied by 100 after calculation.
Code:
] sm_botpow
--> Physical Player Difference <--
Round: 1 ^ 2.15 = 1
Round: 2 ^ 2.15 = 4
Round: 3 ^ 2.15 = 11
Round: 4 ^ 2.15 = 20
Round: 5 ^ 2.15 = 32

--> Low Uneven Skill Percent Difference <--
Round: 100 ^ 1.75 = 1
Round: 200 ^ 1.75 = 3
Round: 300 ^ 1.75 = 7
Round: 400 ^ 1.75 = 11
Round: 500 ^ 1.75 = 17

--> High Uneven Skill Percent Difference <--
Round: 100 ^ 1.89 = 1
Round: 200 ^ 1.89 = 4
Round: 300 ^ 1.89 = 8
Round: 400 ^ 1.89 = 14
Round: 500 ^ 1.89 = 21

--> Even Skill Percent Difference <--
Round: 150 ^ 1.39 = 2
Round: 200 ^ 1.39 = 3
Round: 250 ^ 1.39 = 4
Round: 300 ^ 1.39 = 5
Round: 350 ^ 1.39 = 6
For the bottom three i'm trying to solve the following equation: b ^ 1.89 = 5. Any help would be greatly apperated. I can't figure out how to use the logarithm function.

Last edited by stickz; 02-03-2019 at 20:33.
stickz is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 02-04-2019 , 03:04   Re: Solve Exponential Base
Reply With Quote #2

b = 1.89root(5)

Not square root, but root of base 1.89.
5 ^ x = 9 --> x = Logarithm(9, 5)
x ^ 5 = 9 --> x = Pow(9, 1/5)

Quickly check I'm not wrong. The 1 / 5 simulates base root
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334

Last edited by eyal282; 02-04-2019 at 03:12.
eyal282 is offline
stickz
Senior Member
Join Date: Oct 2012
Location: Ontario, Canada
Old 02-04-2019 , 11:21   Re: Solve Exponential Base
Reply With Quote #3

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
My code is rounding to ceiling instead to nearest like I want. Is there any way I can resolve this issue and calculate the nearest value instead?

Last edited by stickz; 02-04-2019 at 11:24.
stickz is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 02-04-2019 , 11:23   Re: Solve Exponential Base
Reply With Quote #4

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
stickz
Senior Member
Join Date: Oct 2012
Location: Ontario, Canada
Old 02-04-2019 , 19:00   Re: Solve Exponential Base
Reply With Quote #5

The issue I have is 1.64 ^ 1.39 almost precisely equals 2. This not entirely the behavior I want.

I'm trying to calculate the base using IEEE rounding standards, that would round upwards to 2.

For instance 1.35 ^ 1.39 would equal 1.5176 which would round upwards to 2 using IEEE standards.

I think a logarithm is required for this behavior. I can't just raise the value to 1 / exponent.

Last edited by stickz; 02-04-2019 at 19:04.
stickz is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 02-05-2019 , 05:43   Re: Solve Exponential Base
Reply With Quote #6

Quote:
Originally Posted by stickz View Post
The issue I have is 1.64 ^ 1.39 almost precisely equals 2. This not entirely the behavior I want.

I'm trying to calculate the base using IEEE rounding standards, that would round upwards to 2.

For instance 1.35 ^ 1.39 would equal 1.5176 which would round upwards to 2 using IEEE standards.

I think a logarithm is required for this behavior. I can't just raise the value to 1 / exponent.
I don't 100% follow you but not rounding appears to be what you're trying to do. Instead of rounding 1.5176 to 2, keep it 1.5176.
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 02-08-2019 , 20:51   Re: Solve Exponential Base
Reply With Quote #7

Which specific operation are you claiming is wrong?

The output you gave us not helpful because it doesn't show the true value of mult, so we can't really verify anything. From only the code you gave and the output it produced, it doesn't look like anything is wrong. (You're also printing like "373 ^ 1.75 = 10" but obviously you're not doing 373 ^ 1.75, so that's not helping you try to explain anything.)
Fyren is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:25.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode