Mathematical functions : log and ln #5990
navy-cap-echo
started this conversation in
General Discussions
Replies: 1 comment 3 replies
-
This is the convention in the standard library in c which is what Godot uses, but adding log10 would make sense, python math library also uses log to mean natural logarithm, so changing log to mean base 10 would be confusing and compatibility breaking, confusing as the calculator convention isn't the only one and many programming languages don't use the same conversation |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello
Again today, I spent far too much time debugging a "mathematical" godot program that seemed incorrect but was not due to the use of the "log" function !
As specified in the documentation, the log function :
As a reminder :
log(x) = ln(x)/ln(10)
So, i should replace all my log calls by
log(x)/log(10)
, which will make the code even more confusing !To add clarity, couldn't we just rename this function to ln (natural logarithm), which it really is ? and add the classic log function ?
Beta Was this translation helpful? Give feedback.
All reactions