Skip to content

Add logarithmic functions - #155

Merged
Xrayez merged 1 commit into
gd3from
logarithm
Nov 26, 2021
Merged

Xrayez merged 1 commit into
gd3from
logarithm

Conversation

@Xrayez

@Xrayez Xrayez commented Nov 26, 2021 •

Copy link
Copy Markdown
Contributor

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