Jump to content



Photo
- - - - -

Prime factorization for FC-200


  • Please log in to reply
4 replies to this topic

#1 Filip12678

Filip12678

    Newbie

  • Members
  • Pip
  • 3 posts
  • Gender:Male
  • Location:Poland

  • Calculators:
    Casio FC-200, Casio fx-991CEX

Posted 18 April 2022 - 07:58 AM

Hi I need prime factorization program for Casio FC-200. I found this on internet:

Lbl 0:"N="?➝A:Goto 2:
Lbl 1:2◢
A÷2➝A:A=1⇒Goto 7:
Lbl 2:MOD(A,2)=0⇒Goto 1:3➝B:
Lbl 3:√A+1➝C:
Lbl_4:B≥C⇒Goto 6:
MOD(A,B)=0⇒Goto 5:
B+2➝B:Goto 4:
Lbl 5:B◢
A÷B➝A:Goto 3:
Lbl 6:A◢
Lbl 7:"END":Goto 0

But i don't have ≥ and MOD function.

I replaced the MOD function using this pattern: MOD(A, B ) = A - B*Int(A/B), but i don't know how i should repleace ≥ into two separate conditional statements (>, =).

Program also have to contain less than 128 steps because that's the maximum capacity of my calculator.


Edited by Filip12678, 18 April 2022 - 08:01 AM.


#2 HappyCalc

HappyCalc

    Casio Addict

  • Members
  • PipPipPip
  • 67 posts
  • Gender:Male
  • Location:Germany
  • Interests:Programming, On-Calc Programming(C.Basic), Gaming, Origami, Eating Chocolate

  • Calculators:
    fx-9860GII-2
    fx-CG50

Posted 18 April 2022 - 08:48 AM

Instead of A≥B you can use Not (A<B )

Edited by HappyCalc, 18 April 2022 - 08:49 AM.


#3 Filip12678

Filip12678

    Newbie

  • Members
  • Pip
  • 3 posts
  • Gender:Male
  • Location:Poland

  • Calculators:
    Casio FC-200, Casio fx-991CEX

Posted 18 April 2022 - 09:42 AM

Unfortunately I don't have NOT function



#4 piu58

piu58

    Casio Freak

  • Members
  • PipPipPipPip
  • 147 posts
  • Gender:Male

  • Calculators:
    Casio Graph 90+E, Casio fx-CG20

Posted 18 April 2022 - 04:48 PM

B>C⇒Goto 6:
B=C⇒Goto 6:

  • Filip12678 likes this

#5 Filip12678

Filip12678

    Newbie

  • Members
  • Pip
  • 3 posts
  • Gender:Male
  • Location:Poland

  • Calculators:
    Casio FC-200, Casio fx-991CEX

Posted 18 April 2022 - 07:18 PM

B>C⇒Goto 6:
B=C⇒Goto 6:

That works, thank you




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users