Eeexactly. You got it.
Well, I have used it in things as well, and it worked in them as well, so I don't know. I understand why * would be the better choice, but when I did it, I did it with +, and it worked, so that is what I am gonna use.
TI-Freak8x wrote:
Well, I have used it in things as well, and it worked in them as well, so I don't know. I understand why * would be the better choice, but when I did it, I did it with +, and it worked, so that is what I am gonna use.
because + ADDS them as numbers, NOT as AND (eg, 1+1=2 for true and true, or 1+0=1 for true and false). * would multiply them, and 0*1=0 (for false and true) 1*1=1 (for true and true). What you said is incorrect, that the calculator would interperate the + as AND. this is NOT the case. It only works in your example because of the A>0 A<8 (or whatever it was) in the same string of commands to prevent a +2 or -2. This is NOT because you are using AND logic
If you want to see this yourself, try this.
Code:
:0->K
:0->A
:Disp ((K>1)+(A=0))
According to what you are claiming, taht the + is the same as AND, then the result SHOULD be 0, but it won't be, it will be 1. Make it so both conditions are true, and it won't be 1, it will be 2. Now replace the '+' with '*' and it will work as an AND
NOTE: Do realize i have no problem with your code snippet, it is that you claimed that + is the same as AND - this is incorrect, and for a newsletter claiming to be "1337 at basic", there cannot be any incorrect statements about how the TI-BASIC language works
Well, it is the way that it worked, takin ands place, that is why I thought it worked like and...
Maybe this should be changed Kerm...
Maybe this should be changed Kerm...
OK, here's how it works:
conditional+conditional is OR
conditional*conditional is AND
not(conditional+conditional is NAND
not(conditional*conditional is NOR
conditional+conditional is OR
conditional*conditional is AND
not(conditional+conditional is NAND
not(conditional*conditional is NOR
KermMartian wrote:
conditional+conditional is OR
yeah, as LONG as you aren't expecting the result to just be 1 or 0, cause you could end up with a 2, and if you are adding it to something, you gotta watch out for that
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
» Go to Registration page
» Goto page Previous 1, 2, 3
» View previous topic :: View next topic
» View previous topic :: View next topic
Page 3 of 3
» 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
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