 Now numeric comparisons that's actually quite a bit of fun and in writing computer code and writing loops and Decision-making trees you're gonna have to use comparisons all the time and when you compare something to each other You're either going to have a true or false as a return So this is called Boolean logic Which is just going to look at whether things are equal or unequal and with unequal We mean they're greater than or less than something else So it's got to be countable in some way and the first comparison is this equality comparison with double equal sign So I can just say the following Three equals equals three So I'm not assigning three to three This is not an equation with the left-hand side or right-hand side when I put two equal signs there This is asking a question is the left-hand side equal to the right-hand side and if I hit Shift into it returns a true it is true that three equals three So I haven't assigned anything I haven't written an equation there I'm asking a question just as much as I can say is three greater than three and that of course is going to return a false for me I Can ask is three greater than or equal to three So it's either got to be greater than or equal to if either of those things if either of those things are two It will return a true value for me indeed because it is equal The less than I can say is three less than three of course that is not so but if I say is three Less than or equal to three. Yes indeed. It is equal. So it's one of those things are two It's going to return that for me. I can also say it's something not equal to so three Not equal to three of course it is so that's going to return a false for me So comparisons you really these type of comparisons come up and code all the time and it's good to know about them Now there are these special There are these special cases in special values In in computer language Julia is no different specifically in Julia we have this in a not a number it's a it's a type and Usually comes up when you have missing values Say for instance in a spreadsheet you have missing values that missing value and amongst all other values is not a number It's just nothing. It's not it's not empty. Really. It's just it's just not a number And then we have positive infinity of course and negative infinity as values So let's look at this curious thing called not a number. Let's say type of what is this what what kind of You know, what what kind of type is it? Well, we see it's a 64 but floating point value Now remember floating points are decimals as I said, we're going to get into what what types are What do we see it's classified in Julia as a 64 but float Now we can ask the question is a not a number equal to not a number What do you think that is going to return? Well, it's going to turn and turn false It can't it can't evaluate these things because not a number is not a number So how can you say that not a number is equal to not a number? It is not a number. It's impossible for the computer to evaluate that I can also ask is not a number larger than Not a number Again, that's going to return a false for me Let's look at infinity What is the type of? Infinity Well, it's also a 64 but floating point value, but infinity now. I'm going to show you 64 but floats have a maximum and a minimum value Above which the computer can't deal with an infinity as well beyond that infinity is something very special But it is classified as a 64 but floating point system because the computer will have to deal with floating point values when it does calculations So what if I add one to infinity? Let's do that infinity. Let's do this. I'm going to say Infinity plus one Is that larger than infinity? And that is false remember infinity is a very special mathematical Concept infinity And adding more values to infinity doesn't make infinity bigger. It is the still infinity So it really is not bigger than adding one to infinity is not really bigger than infinity Even though it is held as a floating point value, which actually if you do add one to that something should be happening there We can really quickly just look at something else is infinity plus one Less than infinity no and there's a little reason why I put that in and we'll have a look at that later If you add one to a maximum value that a variable can hold or type can hold something funny happens But in this case understand that that infinity is a specific mathematical entity and we really We really have to deal with it as a a mathematical concept now We can also do logical tests using functions This is we had plus and minus and multiply and divide as functions. We can also do that over here So we can compare values And but this time we have to use words so we can say is equal Let us our little function is equal three comma three And indeed that is true. They are I can ask if something is finite is finite Now a stupid example here. I'm just going to pass an integer there is an integer finite indeed. It's true It is It is really I can ask if something is infinite is infinite now three infinite Uh, definitely not that's going to return a false for me. Now. What about nan values? I can say is nan And let's put in a not a value And indeed that is true not a number is not a number Now, I just want to show you something very peculiar. Let's have zero point zero negative zero point zero is that equal to Zero so here. I'm just using the normal Boolean Person here and it's going to say that is true. I just want to show you this though if I were to say If we were to say is equal And those same things this have negative zero point zero and we have just zero there Let's see what happens there that returns a false So we had it as true when we used the operators here But if we use a function it returns false now There's reasons why that was coded to do that you can create your own kind of comparisons You can write your own code to develop new ones And there's a reason why these had to be separate For reasons that we we need to really be concerned about here It is for you to Be cognizant of the fact that you are going to get true if you do this and for the same values You're going to get negative if you do that Now we used words, but we could really also just do this 3.3 so I can really just use those signs just as we did with plus and minus It's still going to be a function and in this instance. It's going to return a true for us