Primes and primality checking

Mark Waddingham mark at livecode.com
Wed Apr 26 02:43:27 EDT 2017


On 2017-04-25 17:01, Devin Asay via use-livecode wrote:
> However, it doesn’t seem to be reliable for very large numbers (> 100
> digits) as the fellow wants. My math skills are pretty creaky. Anybody
> want a crack at this? It’s a fun challenge, plus it can boost LC’s
> presence on stackoverflow.

You can only represent integers up to around 2^53 without losing 
precision (as they are represented using IEEE doubles) which means the 
maximum number you can check for primality using this method is around 
9007199254740992.

Warmest Regards,

Mark.

-- 
Mark Waddingham ~ mark at livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps




More information about the use-livecode mailing list