Post Reply 
50G fraction question Q-> function max denominator
10-26-2019, 08:56 AM
Post: #11
RE: 50G fraction question Q-> function max denominator
(10-25-2019 11:42 PM)Joe Horn Wrote:  
(10-25-2019 09:42 PM)100LL Wrote:  Is the port to the 49G+/50G really that simple by the way?

Yes, although now that I think about it, I'd suggest replacing this:
# 5603Eh SYSEVAL
with this instead:
R\->I SWAP R\->I SWAP /
This eliminates all reliance on SYSEVAL or FLASHEVAL or any dangerous junk like that.

When that replacement is made in the HP 50g, the BYTES command (on the program by itself on the stack, not its name) returns 298.5, #ED4h. That's assuming that it was keyed in while the 50g was in exact mode, so the literal numbers in the program have no decimal points. If entered in approximate mode, BYTES returns 298.5, #8B6Bh.

I just tested it and it works on the 50g. Inputs: pi, 100. Output: 311/99.

It depends on the CAS mode though.

Code:
-2 CF -3 CF -105 CF π 100 DEC2FRAC

prompts to turn on Approx mode, and (after selecting 'Yes') outputs '311/99', and sets flag -105.

Code:
-2 CF -3 CF -105 SF π 100 DEC2FRAC

outputs a horrible, symbolic continued fraction.

Code:
-2 CF -3 SF -105 CF π 100 DEC2FRAC

outputs '311/99', and clears flag -3.

Code:
-2 CF -3 SF -105 SF π 100 DEC2FRAC

outputs '311/99', and clears flag -3.

Code:
-2 SF -3 CF -105 CF π 100 DEC2FRAC

outputs '311/99'.

Code:
-2 SF -3 CF -105 SF π 100 DEC2FRAC

outputs '311/99'.

Code:
-2 SF -3 SF -105 CF π 100 DEC2FRAC

outputs '311/99', and clears flag -3.

Code:
-2 SF -3 SF -105 SF π 100 DEC2FRAC

outputs '311/99', and clears flag -3.

In conclusion, setting flag -2 is a good idea!

— Ian Abbott
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: 50G fraction question Q-> function max denominator - ijabbott - 10-26-2019 08:56 AM



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