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

Precision deficiency #123

Open
oneMord opened this issue Sep 19, 2024 · 1 comment
Open

Precision deficiency #123

oneMord opened this issue Sep 19, 2024 · 1 comment

Comments

@oneMord
Copy link

oneMord commented Sep 19, 2024

0.48 * 2.38 / 5 * 10 = 1.95159999999

The correct answer should be 1.9516

@RobertZenz
Copy link

exp4j uses doubles, which are floating-point numbers which are by definition inaccurate.

If you need arbitrary precision you need to use something like EvalEx which uses BigDecimal.

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