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

[Question] Lacking advanced math features #199

Open
JoonasC opened this issue Dec 8, 2021 · 4 comments
Open

[Question] Lacking advanced math features #199

JoonasC opened this issue Dec 8, 2021 · 4 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@JoonasC
Copy link

JoonasC commented Dec 8, 2021

Currently this library is lacking advanced math features, such as: sin, cos, sqrt, nroot, log, etc.

Are these within the scope of this library?

If not, what workaround would you suggest?

@JoonasC JoonasC changed the title [Question] Lacking advanved math features [Question] Lacking advanced math features Dec 8, 2021
@ionspin
Copy link
Owner

ionspin commented Dec 8, 2021

Hi @JoonasC ,
This is also related to issue #41.

I'd definitely say that it is in scope of the library, and BigInteger has at least sqrt implemented, but the rest are unfortunately missing. Currently I don't have time to implement them, so contributions are welcome!

As for a workaround, apart from implementing these operations possibly as extension functions or even better contributing them to the code 😃 , I don't have anything concrete to suggest.

@ionspin ionspin added enhancement New feature or request help wanted Extra attention is needed labels Dec 10, 2021
@abudden
Copy link

abudden commented Sep 10, 2022

I can't offer any help with this as my kotlin skills aren't good enough, but this java BigDecimal repository might be a useful reference source for anyone willing to have a go: https://github.com/eobermuhlner/big-math

@hakanai
Copy link

hakanai commented Sep 13, 2022

You've seen the PR, right? The code in there is pretty much inspired by theirs. ;)

They too have some very arbitrary magic numbers for how much precision to add for each operation. That's the one thing that made it both hard to understand and unclear how to map to this library. Doubly baffling, because if you go and look at code for something else like bc, the magic numbers for how much precision to add aren't even the same. (So presumably, one of them is wrong? But which one?)

Sorting out the actual precision requirements for each function is probably the sole thing making it hard. If someone were to go through and say that so and so function needs so much precision when doing each step, someone else could just go through and churn the code out.

@ionspin
Copy link
Owner

ionspin commented Sep 13, 2022

Here is the pull request in question, #235 which I unfortunately still haven't had time to dive into, as it's related to precision refactoring, and I'm trying to launch an MVP for my startup at the same time. Once again, haven't forgotten about it, just no time :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants