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

Wrong computation result for very large numbers #273

Closed
yurivict opened this issue Feb 25, 2024 · 1 comment
Closed

Wrong computation result for very large numbers #273

yurivict opened this issue Feb 25, 2024 · 1 comment

Comments

@yurivict
Copy link

For example:

> (1 lightyear) / (1 µm)
9460730472580800000000
> ((1^10) lightyear) / (1 pm)
9460730472580800000000000000
> ((1^9) lightyear) / (1 pm)
9460730472580800000000000000

For 1^10, 1^9 just 6 zeros were added, when there should have been 10 zeros and 9 zeros added, respectively.

fend should support arbitrary precision numbers in both results and arguments.

GMP, MPFR, MPIR, and many other arbitrary precision libraries are available.

@printfn
Copy link
Owner

printfn commented Feb 25, 2024

fend does support arbitrary precision. You need to write 10^10 or 10^9, not 1^10.

> (1 lightyear) / (1 µm)
9460730472580800000000
> ((10^10) lightyear) / (1 pm)
94607304725808000000000000000000000000
> ((10^9) lightyear) / (1 pm)
9460730472580800000000000000000000000

@printfn printfn closed this as completed Feb 25, 2024
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