Post Reply 
(32SII/DM32) Prime Factorization (edit)
11-17-2023, 08:50 AM
Post: #3
RE: (32SII/DM32) Prime Factorization
Either I've done something completely wrong or there is a bug in the program.
No matter what I put in, it'll return "2,".
Pressing r/s results in the originally entered integer to return to the stack.
Hitting xeq p just continues to return "2,".
Running xeq p with "0" on the stack returns "divide by 0".

Yes, I've quadruplechecked the program listing. It's correct.
No, nothing else in the calc. Brand new state and all vars cleared.
State file in "code" tag and also attached.

Code:

# STACK
SL: 1

# REGS

# FLAGS

# MODE
MTRIG: DEG
MFMT: FIX 4
MDOTINV

# EQUATION LIST
EQNPTR: 0
EQN
EQNEND

# PROGRAM
PTR: 29
PGM
  LBL P
  FIX 0
  STO B
  STO A
  2
  STO F
  LBL B
  RCL A
  RCL\div; B
  ENTER
  FP
  x=0?
  GTO A
  1
  STO+ F
  GTO B
  LBL A
  RCL F
  STOP
  R\down;
  R\down;
  STO A
  1
  -
  x\neq;0?
  GTO B
  RCL B
  FIX 4
  RTN
PGMEND

.zip  Pfact.zip (Size: 364 bytes / Downloads: 3)

Esben
15C CE, 28s, 35s, 49G+, 50G, Prime G2 HW D, SwissMicros DM32, DM42, DM42n, WP43 Pilot
Elektronika MK-52 & MK-61
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (32SII/DM32) Prime Factorization - DA74254 - 11-17-2023 08:50 AM



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