Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Basic Compiler > Re: Very Big nu...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 11 of 26 Topic 70 of 149
Post > Topic >>

Re: Very Big numbers

by Eternal Vigilance <wotan@[EMAIL PROTECTED] > Feb 14, 2004 at 01:56 PM

Tom Lake wrote:

> "Sidney Cadot" <sidney@[EMAIL PROTECTED]
> wrote in message
> news:c0e3ep$h6j$1@[EMAIL PROTECTED]
> > Gernot Frisch wrote:
> >
> > >>Can it also find all 100% proven Prime Numbers?
> > >
> > >
> > > Yes, it can:
> > >
> > > int is_prime(BIG_NUM num)
> > > {
> > >    for (BIG_NUM i=3 ; i<num; i++)
> > >       if (!(test_num%i) return 0;
> > >    return 1;
> > > }
> > >
> > > Muahaha! You didn't say anything about speed, did you :)
>
> You should only have to have the loop go up to the square root of num,
not
> all the way to num to test for prime.  That cuts down the time a bit.
>
> Tom Lake
>
> --
> Capaci Occasio

hmmm   forgot about that -- limit approximation of the square root

(square root of a 100 digit number must be fun just by itself....)


approx is  2 ^  half the numbersbit size + 1     (not + 1 if even???)




 26 Posts in Topic:
Very Big numbers
"ds" <nospam  2004-02-10 20:10:11 
Re: Very Big numbers
Marius Vollmer <marius  2004-02-10 21:29:50 
Re: Very Big numbers
"ds" <nospam  2004-02-10 21:50:59 
Re: Very Big numbers
Peter Ashford <me@[EMA  2004-02-11 11:17:36 
Re: Very Big numbers
"ds" <nospam  2004-02-10 23:28:38 
Re: Very Big numbers
Peter Ashford <me@[EMA  2004-02-11 12:58:31 
Re: Very Big numbers
Sidney Cadot <sidney@[  2004-02-10 23:56:52 
Re: Very Big numbers
"Gernot Frisch"  2004-02-11 16:32:56 
Re: Very Big numbers
Sidney Cadot <sidney@[  2004-02-11 21:31:20 
Re: Very Big numbers
"Tom Lake" <  2004-02-11 22:20:32 
Re: Very Big numbers
Eternal Vigilance <wot  2004-02-14 13:56:34 
Re: Very Big numbers
Eternal Vigilance <wot  2004-02-14 13:51:44 
Re: Very Big numbers
"Vincent Diepeveen&q  2004-05-24 17:02:05 
Re: Very Big numbers
Marius Vollmer <mvo@[E  2004-02-10 23:49:51 
Re: Very Big numbers
"ds" <nospam  2004-02-11 00:14:17 
Re: Very Big numbers
"Bevan Weiss" &  2004-02-11 12:25:47 
Re: Very Big numbers
Peter Ashford <me@[EMA  2004-02-11 13:02:14 
Re: Very Big numbers
Marius Vollmer <mvo@[E  2004-02-11 00:53:23 
Re: Very Big numbers
David Rogoff <david@[E  2004-02-10 18:43:46 
Re: Very Big numbers
support@[EMAIL PROTECTED]  2004-02-10 23:04:04 
Re: Very Big numbers
"ds" <nospam  2004-02-11 19:51:50 
Re: Very Big numbers
Peter Ashford <me@[EMA  2004-02-12 09:13:03 
Private Message
   2004-02-11 11:50:00 
Re: Very Big numbers
"David Brown" &  2004-02-12 10:04:47 
Re: Very Big numbers
Marius Vollmer <mvo@[E  2004-02-12 00:45:07 
Re: Very Big numbers
"Vincent Diepeveen&q  2004-05-24 17:00:31 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri May 16 21:40:29 CDT 2008.