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

But computer doesn’t have endless memory for pi #72

Open
di-sukharev opened this issue Jun 17, 2023 · 2 comments
Open

But computer doesn’t have endless memory for pi #72

di-sukharev opened this issue Jun 17, 2023 · 2 comments

Comments

@di-sukharev
Copy link

Computer memory can’t hold the whole pi, so It happened to be I saved my dog photo exactly after my computer memory ends, how do I get it back???

Actually I’m really interested in how can I store “any” file if computer memory is not endless and in such case I may not find suitable sequence of numbers?

@MaxwellWibert
Copy link

Really easy solution for this one. Just store the digits of pi in pifs. I believe the index is 0.

@onioneffect
Copy link

You don't need to calculate all of the digits of Pi. You can calculate one at a time.

The BBP formula gives rise to a spigot algorithm for computing the nth base-16 (hexadecimal) digit of π [...] without computing the preceding digits.

This algorithm computes π without requiring custom data types having thousands or even millions of digits. The method calculates the nth digit without calculating the first n − 1 digits and can use small, efficient data types. (source)

The program still can't run forever, tough, because of complicated math reasons (1) (2) (3)

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

3 participants