Skip to content
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

Add logarithmic functions #155

Merged
merged 1 commit into from
Nov 26, 2021
Merged

Add logarithmic functions #155

merged 1 commit into from
Nov 26, 2021

Conversation

Xrayez
Copy link
Contributor

@Xrayez Xrayez commented Nov 26, 2021

Adds log2, log10, and log with ability to compute logarithm with arbitrary base.

For instance, I've come up with a way to calculate number of trials in order to achieve some success rate for some probability event via script, which requires finding x in:

  • 1 - (1 - p)^x:
func trials_until_success(event_probability, success_rate = 0.99):
    return GoostMath.log(1.0 - success_rate, 1.0 - event_probability)

Adds `log2`, `log10`, and `log` with ability to compute logarithm with arbitrary base.
@Xrayez Xrayez added enhancement Improvement of existing features component:math ➕ labels Nov 26, 2021
@Xrayez Xrayez added this to the 1.2-gd3 milestone Nov 26, 2021
@Xrayez Xrayez merged commit c01ed1b into gd3 Nov 26, 2021
@Xrayez Xrayez deleted the logarithm branch November 26, 2021 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:math ➕ enhancement Improvement of existing features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant