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

Is it possible to increase Algebrite precision? #128

Open
Saikedo opened this issue Oct 2, 2020 · 1 comment
Open

Is it possible to increase Algebrite precision? #128

Saikedo opened this issue Oct 2, 2020 · 1 comment

Comments

@Saikedo
Copy link

Saikedo commented Oct 2, 2020

Is there an option in Algebrite to increase calculation precision?

Algebrite.eval(5+0.0000001).toString() returns 5.0 instead of "5.000001" and I was wondering if there is a way to increase the precision for stuff like this.

I am using Algebrite mainly for .expand function and take a look at this case for example. I know the expansion on this example does not do anything meaningful but the issue is there none the less.

Algebrite.expand("(x)^(2)-(y)^(2)-0.000001").toString() correctly returns "-0.000001+x^2.0-y^2.0"

but

Algebrite.expand("(x)^(2)-(y)^(2)-0.0000001").toString() truncates the constant and returns "-0.0+x^2.0-y^2.0"

Not good...

@thunderkid
Copy link

There's a PR here for increasing the precision, but it's hardcoded and fairly limited in its scope. I haven't tested it myself since I need something broader in my own use case. (My own solution is to replace all decimals with algebraic variables, then use my own logic to evaluate them to required precision after algebrite's performed its algebraic simplifications. It's pretty ugly to have to do this.)

@davidedc davidedc changed the title Is it possible to increase Algebrite precission? Is it possible to increase Algebrite precision? Mar 28, 2021
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