Prime 1.0 Copyright (C) 1997 H†kon Stordahl E-mail : stordahl@usa.net Homepage: http://stordahl.home.ml.org/ Date : 09.06.97 Model : CASIO CFX-9850G Calculator Notes -------------------------------------------------------------------------------- This program will determine whether a number is a prime or not. Symbol: Description: Key(s): -------------------------------------------------------------------------------- -> Assginment operator Above [AC/ON] * Multiplication Below [DEL] / Division Below [AC/ON] (-) Unary minus Below [+] = Equal to [SHIFT] [.] <> Not equal to [SHIFT] [VARS] [F6] [F3] [F2] >= Greater than or equal to [SHIFT] [VARS] [F6] [F3] [F5] <= Less than or equal to [SHIFT] [VARS] [F6] [F3] [F6] => If-Then [SHIFT] [VARS] [F3] [F3] \sqrt Square root [SHIFT] [X^2] \slash / (slash) [F6] [F5] \{i} \sqrt(-1) [OPTN] [F3] [F1] Frac Returns fractional part of argument [OPTN] [F6] [F4] [F3] ClrText Clear the text screen [SHIFT] [VARS] [F6] [F1] [F1] Getkey Determine keypress [SHIFT] [VARS] [F6] [F4] [F2] Locate Display variable at the given coords [SHIFT] [VARS] [F6] [F4] [F1] { Left brace [SHIFT] [*] } Right brace [SHIFT] [/] [ Left bracket [SHIFT] [+] ] Right bracket [SHIFT] [-] List List-variable [OPTN] [F1] [F1] Sum The sum of all entries in the list [OPTN] [F1] [F6] [F6] [F1] And Logical And operator [OPTN] [F6] [F6] [F4] [F1] Or Logical Or operator [OPTN] [F6] [F6] [F4] [F2] Not Logical Not operator [OPTN] [F6] [F6] [F4] [F3] File name: PRIME Variables: D, I, N -------------------------------------------------------------------------------- ClrText "ENTER NUMBER: "?->N 0->D 3->I (((Frac (N/2)=0 And (N<>2)) Or (N<=1) Or (Frac (N)<>0))->D Not D=>\sqrtN-Frac (\sqrtN)+1->J While (I<=J) And (Not D) Frac (N/I)=0->D I+2->I WhileEnd If Not D Then "PRIME NUMBER" Else "NOT PRIME NUMBER" IfEnd --------------------------------------------------------------------------------