Prime Number Test - identifies primes
toolbar-separator.png This page has been deleted from the main contents of the wiki, and moved to the deleted: namespace as a record of its contents. Rather than adding content to this page, please put it somewhere where it will actually have a use. In addition, please avoid linking to this page.

This program identifies whether a number is prime.

NOTE: This program does not display a correct result for 0, 1, or 2, which are special cases.

:Prompt X
:If fPart(X/P)*P=0
:Goto E
:Lbl E
:If Y≠­1
:Disp X
:Disp "Composite"
:Disp "Divisible by"
:Disp Y
:If Y=­1
:Disp X
:Disp "Is prime"

(If you plan to copy and paste this string of code into a program editor remember to remove the colons.)

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 2.5 License.