Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.
Eeexactly. You got it. Smile
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.
It's always good to go with what works. Cool
Would be cool to know HOW it works though.
What happened to my article? Sad
That's gonna be in the next one, remember? I need to convert over all the imgs and such.
Oh, okay, I missed that...
Yup, I'm probably gonna put it all in at once, or break it into two pieces instead of 4.
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...
OK, here's how it works:

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
I mean something like (X=1)+(Y>4)
  
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 3 of 3
» All times are GMT - 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