Launcher Update
Get the Desktop App for Battle.net Now
 All your games in 1 place
 Log in once
 Automatic game updates
Is it possible to do this? I know someone who is trying to make a map that calculates SQ (Spending Quotient) on the fly, but doing so requires computing a natural logarithm. Has anyone else solved this problem already? Is Blizzard going to add in an ln function?

From http://www.teamliquid.net/forum/viewmessage.php?topic_id=374400¤tpage=17#332 : Ok, now those are the two big numbers needed to calculate SQ. Here is the third giant problem: there is no mathematical function for calculating the natural log of a value in the editor. Not really a HUGE problem, but definitely a problem. I would then have to calculate the Taylor series or an Infinite series and traverse a certain number of steps to determine the natural log by hand (via computer ). Then use that value to calculate SQ. Are you sure there is a log function? The map developer for TheStaircase custom map seems to think one does not exist. 
Open the Trigger Editor, make two new variables, one REAL one INTEGER, then take a look at what functions are available. (Especially in the MATH part).
Rather than list them all out and say, is this one any use, it would be better for you to go take a look :) 
Open the Trigger Editor, make two new variables, one REAL one INTEGER, then take a look at what functions are available. (Especially in the MATH part). I believe this is what the mapmaker for TheStaircase map (see the TL thread) has already tried. I can try it too, although I'm a huge noob with the editor. It's my understanding though that none of the math functions include logarithm calculations. 
Randomly checked a bit, there is only Log2 and checking its galaxy code equivalent ( "Log2I(value)" ) sure don't imply something different than base 2.
So if there is a way, it might be deep into some galaxy code documentation somewhere but not from the Editor UI. I am afraid he might have to calculate/mimic it as best he can. The only suggestion I have is if mimic'ing requires too much execution time and there are a lot of the SAME values/results, he might want to "hardcode" the sets of logs/values into the precalculated results into a 2D array. Ex : LogResult[2][4] = 2. The first index being the log base and 4 being the number. or perhaps LogResult[20][4] = 2 . Thus the first index being 2.0 for 1 decimal if the index numbers goes up to 800 max (considering 8000 max or so for the array). Obviously that would only work if it's a not a huge set of integers (and not reals). If his potential pool of results is big, it won't help that much. EDIT : If you are honestly going that way, obviously have some program (c++ or something) that mass calculate everything you need. If you are going to make it into galaxy code, preferably output all the galaxy code lines to mass copy them as "Custom Script" (actiontype) in the Trigger UI. EDIT 2 : Do factor that doing so will probably greatly increase the loading phase of your map.
Edited by Honejasi on 12/6/2012 10:11 AM PST

If I remember my maths lessons of yonder year...
http://en.wikipedia.org/wiki/Logarithm#Change_of_base logb(x) = logk(x) / logk(b) therefore to calculate ln(x)... ln(x) = log2(x) / log2(e) Since its been a long time since I've mathamaticized anything let me pick some random number to check. Let x = 4321 ln(x) = 8.37124 log2(e) = 1.442695 log2(4321) = 12.07715 log2(4321) / log2(e) = 12.07715 / 1.442695 = 8.37124 whelp, with a sample size of 1 (very scientific) it seems to be correct. So all you have to do if you want to calculate ln(x) is calculate log2(x) and divide by 1.442695 and it should give you the answer. EDIT: Ninja'd
Edited by turtles on 12/6/2012 10:28 AM PST

Threats of violence. We take these seriously and will alert the proper authorities.
Posts containing personal information about other players. This includes physical addresses, email addresses, phone numbers, and inappropriate photos and/or videos.
Harassing or discriminatory language. This will not be tolerated.