Heenan, Lambert
Lambert.Heenan at AIG.com
Wed Dec 14 09:09:37 CST 2005
The wall you hit up against (2,147,483,647) is simply the limit of the number that you can plug into a long integer (2^31). It is an interesting coincidence that this number happens to be prime, but it is just a coincidence. Your approach to trying to find large primes than this is inevitably flawed because what you are now doing by using simple division is *floating point* math, which is inevitably inaccurate due to the physical limitations of binary computers. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Mark A Matte Sent: December 13, 2005 4:55 PM To: accessd at databaseadvisors.com Subject: Re: [AccessD] Weekend fun: Primes Gustav, I still don't know why this intrigues me...but I found away around the 2,147,483,647 problem I was having...I got rid of the MOD function, just used division instead, and used Instr(1,RemainderTest,".") to see if the number had a decimal. Not sure what I will do with this new knowledge...but I now know alot of large Prime numbers. Now that I have a db that will tell me if any number is prime...any suggestions, if any, of what to do with it? Thanks, Mark -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com