I looked into custom number types/functions and that seems beyond my ability. I altered the formula to work on a smaller scale. Even if the prices don't work exactly as well as the last one, I think its reasonable enough.
Looking at especially the (p * q) part of the equation, I realized that since the values will often be around the millions, I would have to pay close attention to that part of the formula and drastically decreased the scale. Surprisingly with the reduced scale, it was off my intended output by only 5% at its worst.
Hello. I have a shallow understanding of programming and even after some research, can't really understand what custom floating points / fixed point libraries are. I do most of my coding through the GUI.
I'm trying to make a supply/demand curve with a functioning market to determine resource prices, in this case, it is food.
Hello, I am making use of a formula which involves long numbers in my starcraft map.
Everything goes fine until I have to get the square root of a number greater than the real number limit (524287), then the math just overflows (circled in red above). I am not very good when it comes to math and don't know much about the best practices for decreasing the scale of the numbers. If it was a linear equation, I would just divide everything by a number and then multiply it by that number afterward. However, the presence of logarithms and exponents makes it so I'm not sure how I would decrease the scale of this equation.
Please advice on how to alter equation or ways of getting the square root of a number > 524287 in the Starcraft Editor
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
In reply to Forge_User_04585675:
In reply to Forge_User_04585675:
Hello, I am making use of a formula which involves long numbers in my starcraft map.
Everything goes fine until I have to get the square root of a number greater than the real number limit (524287), then the math just overflows (circled in red above). I am not very good when it comes to math and don't know much about the best practices for decreasing the scale of the numbers. If it was a linear equation, I would just divide everything by a number and then multiply it by that number afterward. However, the presence of logarithms and exponents makes it so I'm not sure how I would decrease the scale of this equation.
Please advice on how to alter equation or ways of getting the square root of a number > 524287 in the Starcraft Editor