By two numbers, we're having different type of numbers.
We can present in Biton, we shall be discussing on that number data types.
So pite on support street number data types.
The first one is the indigent.
These indigent numbers like your one hundred two zero three zero.
Something like this as an example, flooding by numbers.
These examples are given and complex numbers are to be written in this particular format.
So like your three plus four G five plus 10 G.
In this way we can use a type function to know which class available are a belongs to an instance function
to check if it is belong to a certain particular class or not.
So we are having two functions.
One is a type which will tell the type of the function.
Another one is the instance which will tell whether this particular a variable is object type or not.
Why integers can be of any lend a floating.
My number is accurate.
Only up to 15 decimal places.
There is a sixth in the decimal place will be incorrect in that case.
So that is a decision we are having for the floating by number.
But in case of individuals while integers, it can be of any length numbers.
We deal with everyday a decimal.
That is the best 10 number system.
Python can also express binary octal and hexadecimal numbers.
Also, as computer programmers, generally embedded programmers need to work with the binary.
The binary number system is having the best two or the hexadecimal.
That is the best sixteen and opto, that is the best eight number systems in Python.
We can present these numbers by appropriately placing a prefix before that number.
Now, what are the prefix?
So here to see we can write here as Gedo Small B or Gedo capital B as a binary number prefix.
We're having this Gedo small or or zero capital law as Opteron number prefix, but having zero small
X or Gedo capital X as hexadecimal number prefix.
So these are the prefix we are having to represent the respective number.
No type conversion from one type to another type.
We can do the conversions accordingly.
We can also use the building functions like your iron deep.
We can convert to their respective digit float and complex functions to convert between types explicitly.
These functions can even convert from strings so it can take a string as input and convert it to integer.
In this case, convert to float.
In this case and convert the conflicts complex number in the using this particular complex function.
So I think let us go for one demonstration where we'll be discussing how these numbers can be operated.
Can be handwrote.
Can be doing the typecasting in about python coding numbers in Bryton can have merely three different
data types.
First one is the integer.
So here you see the value.
One is equal to 100.
So this 100 is of type integer and then we're having the next one as flawed in this offload value.
Two is the goal 224.
So it is of the type float class.
And this particular float will always have some decimal point here and fractional part will be there.
And then you are having the another type that is known as a come on plex.
And this complex type numbers will be expressed in the form of the scripting plus six J.
So it is one of the examples we have given.
So we are having three different types added.
One is the iron.
The next one is a float.
And the last one is a complex class.
In about Biton, an integer and floating by numbers are separated by the presence of our absence of
that decimal point.
So in case a five foot eight, only five, it is an integer.
But if we write the five Bunjil rule, it will be up that I float.
Okay, so now here you see where having this value one initialize with the value one hundred and then
we are going for print type of value.
And also we are checking is instance value on I in deep value unflawed and value one complex.
If I execute this particular part we are getting this type as class type I N.T. and this is in stand's
will always return a boolean.
It will check that this value one is of the type I enter or not.
And that is true here.
But in case of load and complex, it is returning false.
Similarly, you're are doing the same type of testing here in case of error too.
If I go on executing, we're getting the record output so value to comma I.A. if we pass these two parameters
to ease instance, I'm getting the output falls.
But here in this case, as this value is Opdyke flawed, so is instanced value to offload will return
true and value to comma complex return false.
So now let us go for this complex.
So here we are having value three Ziegel, two feet deep plus six J.
So if we go on executing, we're getting the output like this.
So in gets up.
I ntn because of flawed with there is instance method we are getting this false.
But with the complex is instance Vello 3Com a complex.
It is returning true here.
So in this way we have tested that how that number in stands can be tested or the number type can be
tested using the method.
Is instance this Biton in Jessup up Iten.
Also we can have other different corresponding representations of data.
There is a binary which will have the best two higson hexadecimal which will be having the best 16 and
octal which will be having the best eight here.
So number we deal with about every day are having the best 10.
That is about decimal numbers.
But other than this decimal, you can work with the best two.
That is a binary number system.
We are having this hexadecimal with the best 16 and octal with the best eight here.
So to represent one binary number, we can easily write a zero B as a prefix to this number.
You can write this being the capital letter also.
So if we go on printing this G to be one one, G to one, that means this one one G to one is not in
decimal but in binary G2 X and stand for the hexadecimal and G2 all will be standing for this octal
here.
So now let me let me go for the execution.
You can find that if I execute this part I'm getting 13 because eight plus fold.
That is plus one that is Hardan here because this particular places have in the place where you put
up zero.
That is one this particular place places having the place.
But what I want that is to deliver up to that is four and three.
That is eight.
So eight plus four.
Plus one.
Thirteen.
We are getting hit.
So in case of this G2 X, a, b so A's having the value in hexadecimal at ten.
So 16 to the part of one in 10.
We're getting here 160 and B's.
I mean the value.
Eleven.
So eleven into six into the port of zero.
So you are landing with eleven only.
So 160 plus eleven.
We're getting the value one seventy one.
In the last case you can find that it is two into.
It did go to one because it is represented in the terms of octal.
So two into a two to one plus three and two ated Brazil.
So we are getting these values.
Sixteen plus three.
And that is nineteen here.
So in place of writing this small B can also go for the capital B.
This is I'm replacing this one as Capital X and replacing this one as capital.
Then also we are going to get the same output here.
Now, here you see here, we're having this particular value, 10 in terms of integer and thirteen point
four is nothing but a floor data.
So what will happen if you go on printing this one?
So you see the result is being converted to the respective float here.
So operations like addition, subtraction, which all which you deal, which is dealing with this integer
and the float, and then automatically it will be converted to the float implicitly.
So here to see we're having this in digit operand here, we're having this float apparent.
If anyone of our part in this float, then the result will be implicitly converted to the floor type.
So now we are going to have this type conversion.
So ten point five is up that a float.
And if you want to convert it to integer, we can get output like this.
So 10 is getting output is producing output.
So now here we are having this minus twenty point nine nine.
So it is a float type.
So if we do the type custom integer, we're getting this one as minus 20.
So we can find this one that when we are doing the conversion to integer, it is not changing the sign
of the number.
So here we are having this float then.
So this 10 is of the type integer because there is no fractional part, there is no decimal point.
But as I did the type conversion here.
So output has become ten point zero.
Now consider this example.
Data one is equal to two point one plus jitterbugging two.
And you were just printing the value of data one.
So if I exude this code, we're finding that we are expecting we were expecting the value should be
printed as zero point three because zero point one plus two point two should be due to open three.
But you are finding that, but having so many different zeros after that and then 140 is coming.
So it is an error is getting cost due to the hardware of our system, not due to the python.
So if we want to check whether you look plus one plus D2 plus how do you define one plus Japan two is
do you happen three or not.
Then in that case we'll be finding that the condition is giving the output as false.
To overcome this issue, we can use that decimal model that comes with Biton.
And while floating print numbers have the position of 215 decimal places and the decimal model has user
citable position accordingly.
So here you see we're having this data.
One is the call digit lupine one plus zero point to print data one.
So we are getting this output as you do Pinetree and makeable number of zeros and four and then heroes
who we are just doing one calculation that is zero point one point two zero into two point 2.5 zero.
And you are printing the value of data one.
We are getting this trip and you too, as well.
So now from decimal import decimal as a D.
So if you know, do the calculation in this way, you can see the rate in this particular code.
And we are going to print the respective result.
We're getting the value as zero point three, which which was expected.
And for this outcome, we are getting this output as and three point G digital.
So in this way, the problem which we're are facing in case up by tonn can be overcome.
Using the from decimal import decimal here does this dismal day will be in the sparkies.
So here we are.
Use one alias that is as Dehnart.
Now we shall discuss fractions.
Biton provides operations involving fractional numbers through its fractions model.
And this fraction model will help us to convert one fluting by number to a new monitor Doumitt form
where both the new monitor and the denominator will be Opta type integer.
Actually, Fraction has a new monitor and a dual monitor.
And both of which are integers.
And this model has supples for rational number arithmetic.
So let us go for this example here.
So you see that from fractions import fraction as F..
And this is a respected model at executing here.
So you can find that one point five can be expressed in terms of three by two.
And this three is nothing but one integer new monitor and two is nothing but an integer, which is being
which has been placed as a denominator.
So print F five.
Which will give you the five.
And print F one.
Come off.
I will give you the value.
That is one by five.
So while creating fraction from float, we might get some unusual results.
And it is due to the imperfect binary floating by numberi presentation.
Unfortunately, fraction allows us to instead shift with the string as well.
And this is preferred option when using the decimal numbers.
Now we shall discuss that math model.
Python offers model like math and the random to carry out different mathematics like your trigonometry,
logarithms, probability statistics and etc..
So just consider this setup code.
So Biton math model.
So we have imported the math and then we have we used multiple different functions available in the
math here.
So by calls log log up, then you XP factorial and signage.
So here is the respective outputs we're getting here.
So if we want to print, if we want to print the absolute opposite, minus twelve point two for if during
this one.
Then in that case, we need not to use that math model here so we can use likely as a B.S. minus.
Well, 24, you can find that we are considered only the magnitude part and assigned part has been ignored.
Now, let us come to this.
That is a random here.
So here to see we are going for the random, random random range that is Hypercom fifteen.
So the initial value is a start value.
Which is optional.
If you don't provide an initial value, the value will become considered as zero.
And the last one, the next one value.
That is a second argument where passing is a mandatory that is the dominating value of the stock below.
And that is exclusive.
Naquin ZF The random numbers will be generated inclusive five to 15 exclusive.
So in this way you can go on printing and we can generate multiple random numbers idea.
So the first value is optional.
That is the.
And there is a start value.
The second value is mandatory.
That is a stop halloo.
Then you can also put another argument, comma after putting comedy at.
That is a that is a step below.
So here we have printed ran drench in between five to 15, four times.
So now you're having this.
Eleven, eight, 14 and 13.
If a executer called once again, we're getting that different set of values.
If we execute a code one second, we're getting different set of values.
So now we are having one loose here, then random dot choice day.
So day is nothing but a list here to see it has picked up the random choices to you.
If you go for execution once again, we're getting this value as do here once again.
So if you go for it again.
You can find that they're getting hit, Mondher.
So now that is a print day.
Now we are going for random NAFLD day and then if we print data, we can find that this is their respective
different ad enjoyment of this list.
Elements, at least elements have suffered.
And then we are having this print random elements in front of Brinda random element that the method
is random.
So we can bring the respective random element here.
So in this way, in this particular program, we have discussed multiple different aspects of offer
number type in about Python.
So let us go for a quick revision.
So type is actually returning.
That type of the variable is instances actually checking whether this particular variable is having
this type or not.
So that's why this is instance is actually turning to outfalls.
So we have tested that one on integer.
We have tested that one on flawed Web district, one on complex numbers.
So here we have we are expressing numbers in terms of binary.
So the prefix will be Gedo B, B can be small liquor or capital letters for the hexadecimal.
The prefix should be Gedo X, X can be Lorqess or in the upper case.
And for the octal we are having this Balou which which will be having the prefixes, Gedo or or can
be in the laughers or apartness.
So here you can find that whenever we are doing some calculations involving integers and float, the
result will get implicitly converted to the float.
But having to describe conversion from this float to the integer from this group to the integer from
this in digital, the float respective outputs idea.
We have discussed this decimal here.
How we can deal with that.
We can have the control over the positions.
And then we're having this byte on fractions.
You can see that how the factions are working.
And then the Met model and also the random model here.
I think now you're getting this idea that how this numbers are getting handled in about by programming.
Thanks for watching this video.