[fpc-pascal]isprime()

astlab at inwind.it astlab at inwind.it
Fri Feb 7 18:32:10 CET 2003


I made a function of 116 lines in assembler:

isprime(n: cardinal): boolean;

which returns true if a cardinal is prime, false otherwise.
The routine is fast and uses only an array of 18 cardinals and six
cardinals as local variables. Obviously it may be used by an external
unit, anyhow let me know if it might not be bad the idea to implement
the function on the compiler.

Franco Milani




More information about the fpc-pascal mailing list