Raised This Month: $51 Target: $400
 12% 

How to calculate yroot in sourcemod ?!?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
stickz
Senior Member
Join Date: Oct 2012
Location: Ontario, Canada
Old 12-19-2016 , 20:26   How to calculate yroot in sourcemod ?!?
Reply With Quote #1

I have an exponential equation where i'm trying to solve for the exponent. I managed to simplify it, but can't seem to figure how to take the yroot of something in sourcemod.

Here's an example of what i'm trying to do, with changing variables.
Value = Base * Multiplier ^ x
7000000 = 500000 * 1.9 ^ x
14 = 1.9 ^ x
14 yroot 1.9 = 4.011 (approx)

Code:
float CalculateYRoot(int value, int base, float multiplier)
{
   float simplify = value / base;
   //return simplify yroot multiplier;
}

Last edited by stickz; 12-19-2016 at 20:34.
stickz is offline
Chaosxk
Veteran Member
Join Date: Aug 2010
Location: Westeros
Old 12-19-2016 , 21:46   Re: How to calculate yroot in sourcemod ?!?
Reply With Quote #2

Unless i forgot my math, isn't x in your example 4.112 (approx)?

Using this:
Code:
float CalculateYRoot(int value, int base, float multiplier)
{
	return Logarithm(float(value / base), multiplier);
}
__________________
Chaosxk is offline
Reply



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 09:21.


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