Very Long Numbers....and Primality Tests

61 views
Skip to first unread message

lizzyho...@gmail.com

unread,
Sep 6, 2021, 1:28:30 PM9/6/21
to Harbour Users

Any thoughts about processing LONG numbers in Harbour 3.2?  
The example below is (allegedly) a 200-long prime number.  
It fits easily into a character field....but as far as processing numbers like this, I guess Harbour is not the place.

1.   Can I test this string in Harbour to see if it is a prime number?  (...in a reasonable amount of time?)
2.   If not prime, can I increment the number in Harbour?.....
3.   ....and then repeat the test for primality?
4.   What about EVEN LONGER numbers?

8334961037642895607557531853190051995479647140297515328580455439717145159422227047420672661215448927251032050691587334025204887910343321908627530538723098357639860792002746711623132995925910883269807

L.

Reply all
Reply to author
Forward
0 new messages