 So we've seen how to do these simple calculations, just using these operators plus, minus, multiply, divide and power But we can also use functions to do that So in this section, I'm going to look at the use of functions and we'll say something about fractions as well because we haven't done that Now we're going to have a future lecture all about the types of data that we can use in Julia But I want to show you just now just a little sneak peek type of Type of if I write that and I open and close parentheses and I just put in the value 3 What is the value 3? I'm going to hold down shift and hit the return or inter keys and I see in 64 It's a 64 bit integer. As I say, we're going to have a whole lecture a lesson just about types So it's a 64 bit integer if I say 3.0 So I just went into that cell just changed the line of code. I'm going to hold down shift enter again It'll execute again now. We see that's a 64 bit floating point value But look at this so we're going to look all up all all at all kinds of types in the future But let's do this type of Plus Julia phenomenally, so this plus operator is also a function It can also perform a function now remember from mathematics the f of x equals x squared That's a function if it's a function of x Same in computer programming languages. There's this function and It takes certain values the f of x takes the argument x that x is called an argument in Computer science ways of which is be called a variable in mathematics now. This is a Function in its own right so I can use it like this I can say as I would say the f of x I'm going to say the plus of something now Just let me go back see once I open the parentheses it automatically closes it for me puts the cursor in between a bit of Text completion there in in the Jupiter notebooks. It works really well But I've got to give it some argument now Now arguments are separated by commas and I want to add two plus two So I'm going to say two comma two not two plus two There's a function called plus and I can actually just use a little plus sign instead of writing something like add or whatever Julia it was coded that way that you could use the actual Mathematical sign as a function So look at that if I execute that line of code indeed it is going to be four now I can also add some more four and seven Let's carry on. I'm just hitting keys on my keyboard there. It'll do all of those for me now You see it goes up there to 28. So it's just going to use all of these and it's just going to Pass these arguments to the add function the plus function and it takes what that function does It just adds all the arguments. Let's look at minus I can still say three comma four and again I'm going to get my negative one no problem there multiplication no problem there three times four is 12 Division I can also use division as a function 12 comma four. That's going to give me the three point zero the power Sign there. That's also two comma four. That is 16 So no problem. I can use all these simple operators in In Julia as Functions passing some arguments to a function now just one more thing the fractions If I say three divided by four, I'm going to get 0.7 But if I want to maintain it as a fraction, I can just use these double Divide by signs. So I'm just putting in two forward slashes And if I do that it's going to maintain it as instead of 0.75. It's going to maintain it as Affraction three over four. So I'm going to show that I can calculate the numerator of three divided by four The numerator is three and the key word there's num Key word for the denominator is D in for denominator Three over four and that's going to return the four Julia's quite clever in that it will even simplify Fractions for you six over nine can be simplified to two over three indeed. No problem Look at this another line of markdown So if I click in there that was code if I click in this code cell as the cell it is actually marked down This is double click on it to see how you constructed that so you can see for markdown I can use these little plus signs as long as there's a space afterwards before the line starts that'll be seen as a Little bullet point and here you can see what is called Lartic No, Lartic It's spelled like latex So Lartic code just executes code in a PDF In certain office applications if you have some add-ons, it'll render mathematical notation for you So that's something you can learn how to do with time And I hide them in between these little dollar signs single dollar signs that'll execute them in line And even this value one year in this value two i'm rendering as Lartic images Look also at something else here You see these little stars on either side of a word that changes that text to italics So you can just double click on that and you can very quickly learn something about Lartic there and The use of some more markdown that'll come with time Beautiful bullet points there. I'm rendering fractions there So that's not what I want you to see I want you to see the fact that five divided by three is one and two-thirds So this two is the remainder and indeed we can do that What is the remainder of five divided by three so that rem is a function? I'm passing arguments to that and it's working to work out the fact that that is That that is in d to two now that is To delete let's go to this line of code. I can get both that Solution to the division and the remainder by using different Rem and we're going to have Let's do the five three again and you see three goes into five once with a remainder of two Excellent You've learned all about functions now how to use mathematical functions and we've learned something about Fractions as well and how to do divisions calculating the division and the remainder in the next section We'll take a quick look at associations