FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Search found 4 matches
Forum Index
Author Message
  Topic: bool isPrime(uint n)
parabolis

Replies: 5
Views: 22821

PostForum: Deimos   Posted: Tue Aug 03, 2004 9:40 pm   Subject: Further optimization
First I want to thank jcc7 for the typo and comment suggestion. I fixed them in my code. I am not sure they are worth reposting the whole function again however. It is rather long...

I posted this ...
  Topic: Mango sucks ...
parabolis

Replies: 28
Views: 37872

PostForum: Mango   Posted: Tue Aug 03, 2004 7:20 pm   Subject: Re: Mango vs. std.stream
Yes, they both relate to IO; but that's the extend of it. People focus on std.streams and miss the bigger issue over the serious lack of cohesion within Phobos. And no; mango.io is not even close to U ...
  Topic: bool isPrime(uint n)
parabolis

Replies: 5
Views: 22821

PostForum: Deimos   Posted: Tue Aug 03, 2004 3:44 pm   Subject: bool isPrime(uint n)
Thanks Nick. I have fixed most of the bugs you pointed out and a couple others that became obvious after your comments.

SMALL_PRIMES
bool isPrime(uint n)
{
if ((n & ...
  Topic: bool isPrime(uint n)
parabolis

Replies: 5
Views: 22821

PostForum: Deimos   Posted: Mon Aug 02, 2004 12:18 pm   Subject: bool isPrime(uint n)
Here you are. Let me know if you find bugs.

bool isPrime(uint n)
{
if ((n & 1) == 0) return (n == 2);

if (n < 0x10000)
{
...
 
Page 1 of 1
All times are GMT - 6 Hours
Jump to:  


Powered by phpBB © 2001, 2005 phpBB Group