![]() While some familiar sets of numbers form groups, so do a lot of things that have no numbers in them at all. Like the equality operator, the inequality operator will attempt to. ![]() It is the negation of the equality operator so the following two lines will always give the same result: x y (x y) For details of the comparison algorithm, see the page for the equality operator. There are in fact a lot of branches of mathematics that don't have any numbers in the basic theory at all and don't depend on the existence of numbers as we usually think of them in any way. The inequality operator checks whether its operands are not equal. However, you don't need numbers to do math. Kinkaid, you said "it has 0 so it has actual math". It is just how the results of operations are stored in memory, and giving the programmer access to this let's him do a few tricks to optimize the program.īut I've never before seen anyone get confused by this and think that this treatment of true and false had any mathematical relevance. This also has no mathematical basis true and false cannot be considered integers. I.e, (A != B) is either 0 or 1 (depending on whether it's false or true respectively). However, it doesn't change anything inside of the comparison at all, it assigns the number to the entire comparison. In C/C and Perl, a true comparison is assigned the number 1 and a false comparison is assigned the number 0 (and any other integer is also consider false). To be honest, I have no idea what kinkaid is trying to do with the number 0 and \neq, but it reminds me a bit of how some programming languages such as C/C and Perl treat true and false.
0 Comments
Leave a Reply. |