Tuesday, 3 March 2015

Remainder on division - the program

I discussed the logic for this program in a previous blog. Here is the logic converted into a program for the fx-50F:-

1→B:0→C:10→D:?→A:While D≥A:D-A→D:WhileEnd:Lbl 1:?→X:X=-1=>Goto 2:While X≥A:X-A→X:WhileEnd:C+BX→C:While C≥A:C-A→C:WhileEnd:DB→B:While B≥A:B-A→B:WhileEnd:Goto 1:Lbl 2:C▲

This program is 104 steps in length.

No comments:

Post a Comment