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

Feat: Add math funcs Log10, Log2, Log and Exp #813

Merged
merged 7 commits into from Jan 7, 2022

Conversation

jrmoulton
Copy link
Contributor

@jrmoulton jrmoulton commented Jan 7, 2022

Fixes #755
I'm not sure if the Log10 and Log2 functions need to stay but I added them because both c++ and rust have them as a standard.

@CLAassistant
Copy link

CLAassistant commented Jan 7, 2022

CLA assistant check
All committers have signed the CLA.

@ogoffart
Copy link
Member

ogoffart commented Jan 7, 2022

Great change, thanks!
It just missed tests (in math.60 for example) and documentation (in langref.md)

I wonder if we really need log2 and log10 if we can use log(foo, 2) and log(bar, 10). Also I think exp should take a parameter with the exponent.

@ogoffart
Copy link
Member

ogoffart commented Jan 7, 2022

I realize that C++ and rust and JavaScript calls the exp function with an arbitrary base "pow". So we should have this function as well.

@jrmoulton
Copy link
Contributor Author

exp shouldn't take a power it's just e^x. But I could also add a pow function for a more generic exponential function which I guess might be what the issue was referring to.

I'd lean towards removing log10 and log2 and just using log. By the same token should I remove exp and just implement a pow function?

@ogoffart
Copy link
Member

ogoffart commented Jan 7, 2022

Looks good, thank you.
We'll merge once the CI passes.

@ogoffart
Copy link
Member

ogoffart commented Jan 7, 2022

Ah, it is still missing the documentation in langref.md
And it also deserve an entry to the changelog.

@jrmoulton
Copy link
Contributor Author

There we go. That should be all of it (hopefully the changelog entry looks fine)

@ogoffart ogoffart merged commit c5c139f into slint-ui:master Jan 7, 2022
@ogoffart
Copy link
Member

ogoffart commented Jan 7, 2022

Perfect, thanks!

@jrmoulton jrmoulton deleted the math_funcs branch January 7, 2022 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

exponent and logarithm math functions
3 participants