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

Allow arbitrary precision for LN(10) #143

Closed
AnyhowStep opened this issue Feb 27, 2020 · 1 comment
Closed

Allow arbitrary precision for LN(10) #143

AnyhowStep opened this issue Feb 27, 2020 · 1 comment

Comments

@AnyhowStep
Copy link

AnyhowStep commented Feb 27, 2020

I'm working on a little arbitrary precision library as a hobby project and implemented natural log calculations. I decided to verify the results against decimal.js, since I'm pretty confident decimal.js will give the right result.

So, I tried LN(10) with precision 2000, and got an error that the precision was invalid.
Then, I noticed there was a hard-coded limit in the source code.

A little search revealed a related issue, #130

I was wondering if it was possible to get a version of LN(10) that would actually allow arbitrary precision, with a warning that it could take a really long time. (for, say, 2,000 digits, or 20,000 digits)


[Edit]

I guess I can compare against http://oeis.org/A002392/b002392.txt for now (first 20,000 digits)

@MikeMcl
Copy link
Owner

MikeMcl commented Feb 27, 2020

I was wondering if it was possible to get a version of LN(10) that would actually allow arbitrary precision...

This library does calculate ln(10) to arbitrary precision, but that does not mean that there is no limit, see the docs here.

The value of ln(10) is stored internally by this library to implement the ln function.

This library's sister library decimal.js-light allows the value of LN10 to be changed at runtime, so that the ln function can calculate higher numbers of digits.

As per your link, the value of ln(10) is widely available to thousands of digits.

@MikeMcl MikeMcl closed this as completed Feb 27, 2020
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

No branches or pull requests

2 participants