TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Fast prime numbers

3 pointsby joemanacoover 14 years ago

5 comments

dalkeover 14 years ago
Where "fast" is defined as "involves disk reads" and "prime numbers" should have the qualifier "under 200." The algorithm is brute force testing of all values up to sqrt(n), which is worse than the one the ancient Greeks used.
评论 #2235983 未加载
评论 #2236803 未加载
IChrisIover 14 years ago
Moving a slow algorithm to compile time, or precomputing it, does not make it faster. This title is wrong.
JoachimSchipperover 14 years ago
Are you just submitting everything from your company's blog?
rkneufeldover 14 years ago
Behold, MR.Prime!<p><a href="https://github.com/rkneufeld/mr_prime" rel="nofollow">https://github.com/rkneufeld/mr_prime</a><p>It's a little ruby Miller-Rabin primality tester I wrote with my friend in Crypto class that can handle ~500 digit primes in less than a few seconds. I think my friend also wrote a C extension for it - super fast.<p>Edit: spelling.
评论 #2236223 未加载
ajaysover 14 years ago
Such abuse of the templating system is why I dislike C++.
评论 #2236778 未加载