-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Weird/wrong implementation of power in macros #5117
Comments
I think this is a common pattern:
Documentation of these functions definitely needs to be improved so this is clear. You can use
Results in
|
Mostly valid points. I totally didn't look into math.* . Why isn't math.e taking any parameters? It would have been trivial providing a exponential function. Maybe turn this subquestion into a feature request.
|
I'd add all the answers to the wiki myself, if I knew how to access it. Except how 0.36787... came to be an integer, because that one I don't know. :-) |
Contact Taustinoc (per the main page in the wiki) and he can set up a wiki account for you: https://wiki.rptools.info/index.php/Main_Page |
I added an appropriate comment into the Wiki. Bug can be closed. |
Describe the Bug
All kind of odd numbers appear when using power, log and e. The situation is quite confusing and I don't know which of these functions is at fault. I think the problem is quite old, because MT macro code isn't first choice to do math calculations.
To Reproduce
[r: pow(math.e(),math.log(0.5))]
[r: pow(math.e(),math.log(0.25))]
1
0.367879441171442353448074937747561
Expected Behaviour
0.5
0.25
Screenshots
No response
MapTool Info
1.13.2 and 1.14.3
Desktop
Linux + Windows
Additional Context
The same things happen, when using power instead of pow.
The text was updated successfully, but these errors were encountered: