So I made a mistake when inserting a ►Frac conversion into a program, resulting in the following line(s):

Code:
:A/B->L1(I►Frac
:Disp Ans

Now, this shouldn't have succeeded in displaying A/B as an actual fraction (it's just converting I, an integer, to a fraction...), and yet... it did. Ans was a genuine fraction, despite the token being definitely in the wrong place.

Even stranger, though, is that despite Ans being a fraction, L1(I) is not. ►Dec and its cousins have similar behavior, namely that Ans gets updated somehow after the value is stored properly in the destination. This occurs if called by a program or on the homescreen.

However, there is one remedy to this behavior: if a line like the above is the last line in a program, Ans is not updated. Any other line at all, even one that does not touch Ans, will cause the strange behavior described above.

I have no idea what is going on or if anyone has encountered this before. So if you know or you have, please advise. Thanks.
kg583 wrote:

Now, this shouldn't have succeeded in displaying A/B as an actual fraction (it's just converting I, an integer, to a fraction...), and yet... it did. Ans was a genuine fraction, despite the token being definitely in the wrong place.

Even stranger, though, is that despite Ans being a fraction, L1(I) is not. ►Dec and its cousins have similar behavior, namely that Ans gets updated somehow after the value is stored properly in the destination. This occurs if called by a program or on the homescreen.

This seems like the intended behavior. ►Frac takes what comes before it and converts it to a fraction, and works similarly to the →STO token, in that it waits for what is left of it to be computed before doing the conversion, after the division and →STR. In a similar fashion, L1(I→C stores the content of L1(I) into C, instead of storing I into C

So for your line of code, A is divided by B, that result is stored into L1(I), and then that result is turned into a fraction and stored in Ans.

Also, lists cannot contain fractional forms, they can only contain real and complex decimal numbers.
That's a fair assessment of what >Frac is doing, i.e. behaving like STO.

NoahK wrote:
Also, lists cannot contain fractional forms, they can only contain real and complex decimal numbers.


This, however, is just not true: lists can contain fractional forms just fine. Try it!
mr womp womp wrote:


What did you do to get this?
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement