Message Boards Message Boards

0
|
2140 Views
|
3 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Logical program for not getting indeterminate value

This is giving me indeterminate value. Although I am excluding the indeterminate value by using If statement in line 6. Can anyone help me to correct this logic? Show me where is the problem?

POSTED BY: Kyaw Hla Chak
3 Replies

In very simple cases, like 2!=3, the answer is immediately True, but usually != is meant for further processing, like equation solving. x-1!=0 is solved as x!=1. By itself, x-1!=0 is left as it is.

The test for literal inequality is =!=. It has a different purpose. x-1=!=0 gives True, because the two sides are not the same expression.

Check out the documentation about Unequal and UnsameQ.

POSTED BY: Gianluca Gorni

Thank you. I am new to this. Can you tell me what is the difference between != and =!= ?

POSTED BY: Kyaw Hla Chak

Beware that Subscript[yi, 1,1]!=0 does not give False. You should use Subscript[yi, 1,1]=!=0 for that.

POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract