|Re: WP-34S "PRIME?"|
Message #13 Posted by Paul Dale on 17 June 2011, 6:06 a.m.,
in response to message #10 by Paul Dale
263-1 is the limit here :-( So prime numbers equal to or greater than 9,223,372,036,854,775,837 will not necessarily return true from PRIME? Likewise composite numbers greater than 9,223,372,036,854,775,808 may return false (although this is less likely I suspect). Below these values the results should be accurate.
This limit only applies in integer mode with unsigned 64 bit word size. For all other modes and word sizes, it isn't a limitation.
The code relies on one bit beyond the largest value being available during the calculation and I'm not bothered to work around this (mostly because it will be fairly involved and partly because we're handling pretty large numbers already).
Walter, can you please document this limitation :-)
Edited: 17 June 2011, 6:08 a.m.