(12C) Check if given number is Prime Number or not
09-11-2018, 06:45 AM
Post: #7
 Thomas Klemm Senior Member Posts: 1,447 Joined: Dec 2013
RE: (12C) Check if given number is Prime Number or not
(09-11-2018 05:42 AM)Gamo Wrote:  Is this another rounding problem on the 12C ?

Yes. Since the real HP-12C uses 10 digits: 9,000,000,001 ÷ 2 = 4,500,000,001.
The fractional part of this number is 0 and the program jumps to line 29:
Code:
04 RCL 0 05 2 06 STO 2 07 ÷ 08 FRAC 09 X=0? 10 GTO 29

And thus the program tells you erroneously that this number is divisible by 2.

HTH
Thomas
 « Next Oldest | Next Newest »

 Messages In This Thread (12C) Check if given number is Prime Number or not - Gamo - 09-10-2018, 08:49 AM RE: (12C) Check if given number is Prime Number or not - Joe Horn - 09-10-2018, 04:16 PM RE: (12C) Check if given number is Prime Number or not - Dieter - 09-10-2018, 06:48 PM RE: (12C) Check if given number is Prime Number or not - Albert Chan - 09-10-2018, 10:18 PM RE: (12C) Check if given number is Prime Number or not - Thomas Klemm - 09-11-2018, 03:12 AM RE: (12C) Check if given number is Prime Number or not - Gamo - 09-11-2018, 05:42 AM RE: (12C) Check if given number is Prime Number or not - Dieter - 09-11-2018, 07:18 AM RE: (12C) Check if given number is Prime Number or not - Thomas Klemm - 09-11-2018 06:45 AM RE: (12C) Check if given number is Prime Number or not - Gamo - 09-11-2018, 08:03 AM RE: (12C) Check if given number is Prime Number or not - Dieter - 09-13-2018, 06:35 PM RE: (12C) Check if given number is Prime Number or not - rprosperi - 09-13-2018, 08:52 PM RE: (12C) Check if given number is Prime Number or not - Albert Chan - 09-13-2018, 09:35 PM RE: (12C) Check if given number is Prime Number or not - rprosperi - 09-13-2018, 11:21 PM RE: (12C) Check if given number is Prime Number or not - Dieter - 09-14-2018, 12:18 PM RE: (12C) Check if given number is Prime Number or not - rprosperi - 09-14-2018, 04:19 PM RE: (12C) Check if given number is Prime Number or not - Dieter - 09-14-2018, 06:33 PM RE: (12C) Check if given number is Prime Number or not - rprosperi - 09-14-2018, 08:15 PM

User(s) browsing this thread: 1 Guest(s)