1 00:00:13,490 --> 00:00:16,700 Hello and welcome to the Golang programming language course. 2 00:00:17,990 --> 00:00:23,570 In the previous session, we talked about integer numbers and indecision. 3 00:00:23,840 --> 00:00:27,500 We want to talk about the other data types concept. 4 00:00:34,140 --> 00:00:45,540 Floating point numbers, a floating point number or a float is used to represent real numbers that cannot 5 00:00:45,540 --> 00:00:54,660 be expressed as integers, real numbers include all rational and irrational numbers, and because of 6 00:00:54,660 --> 00:01:03,180 these floating point numbers can contain a fractional part such as seven point five or minus 100 in 7 00:01:03,180 --> 00:01:04,860 twenty three point forty five. 8 00:01:05,850 --> 00:01:12,750 For the purposes of thinking of a float in the go curriculum, it is a number that contains a decimal 9 00:01:12,750 --> 00:01:16,530 point and go language. 10 00:01:16,650 --> 00:01:20,880 Floating point numbers are divided into two categories. 11 00:01:21,150 --> 00:01:32,910 As shown in the below diagram, fellow Terry to thirty two bits or four bytes and floats 64 64 bits 12 00:01:32,910 --> 00:01:34,230 or eight points. 13 00:01:34,560 --> 00:01:43,380 Now let's go to this school to illustrate how to use a floating point numbers like we did with integers. 14 00:01:43,650 --> 00:01:46,980 We convert by floating point numbers in a simple way. 15 00:01:47,400 --> 00:01:50,880 First defined two variables by shorthand declaration. 16 00:01:51,660 --> 00:02:01,290 A column equals and initialize it by a floating point value, for example, thirty five point seventy 17 00:02:01,320 --> 00:02:11,550 eight, and define another variable like B column equals, for example, forty six point twenty six. 18 00:02:13,890 --> 00:02:16,980 Now you want to subtract these variables together. 19 00:02:17,430 --> 00:02:24,840 So first, define another variable like see column equals B minus A 20 00:02:27,510 --> 00:02:39,060 and now display the result value and type of C variable so that if a initialize person if because type 21 00:02:39,060 --> 00:02:46,110 of variable A and B is below, so be used from person if asked, formatted string back is less and and 22 00:02:46,110 --> 00:02:49,620 said, Hey, go to the next line. 23 00:02:50,040 --> 00:02:59,460 F f b initialize % f backslash end and set b. 24 00:03:01,940 --> 00:03:13,610 And if we want to display the result of B minus A, so we right % f for this pretty variable B minus 25 00:03:14,000 --> 00:03:25,460 person, f for disability valuable a equals person, f for variable C because the values are valid, 26 00:03:25,460 --> 00:03:27,940 but it's a and b are decimal. 27 00:03:27,950 --> 00:03:33,440 The subtraction of two variables and b from each other will also be a decimal value. 28 00:03:33,890 --> 00:03:38,120 So if you use five percent if as icing format for the C variable. 29 00:03:39,070 --> 00:03:49,750 And we said B comma, a comma, c now go to the next line and display type of C value that saw B write 30 00:03:49,750 --> 00:04:01,540 f f tie or C column person T uppercase and said C value of it. 31 00:04:02,500 --> 00:04:10,330 Put it back in here and reformat the call, save the project and execute the program. 32 00:04:10,810 --> 00:04:14,680 So go to terminal and execute the program by the comment. 33 00:04:14,680 --> 00:04:18,430 Go round the backslash mean that goal. 34 00:04:20,500 --> 00:04:30,880 Now we can see the output eight equals thirty five point seventy eight and B equals forty six point 35 00:04:30,880 --> 00:04:39,400 twenty six and B minus eight means forty six point twenty six, minus three. 36 00:04:39,400 --> 00:04:44,500 Five point seventy eight equals to ten point forty eight. 37 00:04:44,860 --> 00:04:48,370 And type of C is float sixty four. 38 00:04:50,190 --> 00:04:50,580 OK. 39 00:04:50,730 --> 00:04:57,960 In this edition, we could define floating point variables, initialize them and display in order not 40 00:04:57,960 --> 00:04:59,460 to prolong the time of decision. 41 00:04:59,490 --> 00:05:03,300 We will finish it and we'll continue the content in the next session. 42 00:05:03,390 --> 00:05:03,900 Goodbye.