Jump to content



Photo
- - - - -

Integer price calculator for fx-3650P II

fx-3650P II

  • Please log in to reply
1 reply to this topic

#1 Tritonio

Tritonio

    Casio Addict

  • Members
  • PipPipPip
  • 77 posts
  • Gender:Male

  • Calculators:
    fx-5800P, fx-991ES+, fx-991EX, HP Prime, fx-9750GIII, fx-3650P II

Posted 11 September 2022 - 09:06 PM

Norm 2:
?➝A:
?➝B:
?➝C:
Fix 0:
1➝D:
Lbl 0:
Rnd(DAB+0.5)➝X:
X=DAB+1⇒X-1➝X:
X≥DAB⇒X≤DAC⇒Goto 1:
D+1➝D:
Goto 0:
Lbl 1:
Norm 2:
D◢
X◢
X÷D÷A

I don't know how to call this program but I used it to set prices for things in games where you can only exchange integer amount of currency and items.

 

So for example lets say that 3 fubars costed you 5.46 jubas to make and you want to sell fubars with profit between 15% and 20%. You would type 5.46/3 for A, 1.15 for B and 1.20 for C. Then the program will tell you that you need to sell 6 fubars for 13 jubas at an ~19% profit.



#2 Tritonio

Tritonio

    Casio Addict

  • Members
  • PipPipPip
  • 77 posts
  • Gender:Male

  • Calculators:
    fx-5800P, fx-991ES+, fx-991EX, HP Prime, fx-9750GIII, fx-3650P II

Posted 18 January 2023 - 04:53 PM

You can also use this program to obtain the simplest fraction between to integer values. Say you want an approximation for Pi. Give 1 for A (always 1 when used in this manner), give 3.141 for B and give 3.142 for C. It will give you back the simplest fraction between B and C. :-) At least I think it's the simplest fraction. Just keep in mind that it prints the denominator first and then the numerator.

 

Also you can speedup the algorithm like so:

Norm 2:
?➝A:
?➝B:
?➝C:
Fix 0:
Rnd(1÷A÷C)➝D:
D=0⇒1➝D:
Lbl 0:
Rnd(DAB+0.5)➝X:
X=DAB+1⇒X-1➝X:
X≥DAB⇒X≤DAC⇒Goto 1:
D+1➝D:
Goto 0:
Lbl 1:
Norm 2:
D◢
X◢
X÷D÷A

Edited by Tritonio, 13 April 2023 - 08:04 PM.






Also tagged with one or more of these keywords: fx-3650P II

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users