Prime Number Generators
-
- Posts: 4373
- Joined: February 28th, 2013, 3:23 am
- Location: Oklahoma, United States
Re: Prime Number Generators
Yeah more like 18 quintillion
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com
Re: Prime Number Generators
i guess i went the "long-scale" format (with long-scale it'd be 18 Trillion, which i deem the appropriate form, and with short-scale would be 18 Quintillion i guess)
always available, always on, about ~10 years c/c++, java[script], win32/directx api, [x]html/css/php/some asp/sql experience. (all self taught)
Knows English, Spanish and Japanese.
[url=irc://irc.freenode.net/#pchili]irc://irc.freenode.net/#pchili[/url] [url=irc://luisr14.no-ip.org/#pchili]alt[/url] -- join up if ever want real-time help or to just chat --
Knows English, Spanish and Japanese.
[url=irc://irc.freenode.net/#pchili]irc://irc.freenode.net/#pchili[/url] [url=irc://luisr14.no-ip.org/#pchili]alt[/url] -- join up if ever want real-time help or to just chat --
-
- Posts: 4373
- Joined: February 28th, 2013, 3:23 am
- Location: Oklahoma, United States
Re: Prime Number Generators
Ah, yeah you ain't that old Luis, and you live in 'Merica lol.
I had to look this up since you mentioned "long-scale" and "short-scale".
https://en.wikipedia.org/wiki/Names_of_large_numbers
I had seen a video on this a while back, use to people changed the prefix every million instead of every thousand.
I had to look this up since you mentioned "long-scale" and "short-scale".
https://en.wikipedia.org/wiki/Names_of_large_numbers
I had seen a video on this a while back, use to people changed the prefix every million instead of every thousand.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com
Re: Prime Number Generators
hehe yea, i'm not old, but i'm a US-born hispanic dude, so I basically went with what LatinAmerica uses xD (also because it felt natural to count hundreds, then thousands, then millions, rinse-repeat o_o)
always available, always on, about ~10 years c/c++, java[script], win32/directx api, [x]html/css/php/some asp/sql experience. (all self taught)
Knows English, Spanish and Japanese.
[url=irc://irc.freenode.net/#pchili]irc://irc.freenode.net/#pchili[/url] [url=irc://luisr14.no-ip.org/#pchili]alt[/url] -- join up if ever want real-time help or to just chat --
Knows English, Spanish and Japanese.
[url=irc://irc.freenode.net/#pchili]irc://irc.freenode.net/#pchili[/url] [url=irc://luisr14.no-ip.org/#pchili]alt[/url] -- join up if ever want real-time help or to just chat --
Re: Prime Number Generators
A long time ago I implemented a string based long division algorithm for this very purpose. It was an interesting little challenge and the resulting algorithm was actually quite fast, I recall getting thousands of digits of decimal precision in microseconds for a division operation. The only limitation was that the divisor could be no more than two digits long, however the dividend could be an arbitrarily large integer, which was a limitation of the long division process I modeled the code after. I think the code is sitting on an old dead hard drive so unfortunately I cannot share it.chili wrote:Yeah, divide only primes, divide only up to sqrt(n), only examine odd numbers.
EDIT: actually I think I limited the decimal precision because it wasn't really necessary, what actually amazed me was that I could divide an integer with thousands of digits by any two digit integer and got a result in a fraction of a second. However I'm sure there would be ways to extend the algorithm I wrote to support more than a two digit divisor.