1

00:00:01,130  -->  00:00:07,620
Let's briefly review some of the commonly used methods in the math class you may not use math class

2

00:00:07,800  -->  00:00:13,240
as frequently as a string class but still it is something that you might use from time to time.

3

00:00:13,560  -->  00:00:17,070
So it would be worthwhile to check out some of its methods.

4

00:00:17,310  -->  00:00:23,850
We also know that math class has only static methods and it is also known intangible as it has a private

5

00:00:23,850  -->  00:00:25,220
constructor.

6

00:00:25,290  -->  00:00:29,010
So let's go ahead and look at the math class.

7

00:00:29,760  -->  00:00:35,490
One of the common used matters is that know the method and as the name suggests it basically didn't

8

00:00:35,490  -->  00:00:38,310
set a random number between 0 and 1.

9

00:00:38,760  -->  00:00:40,300
Here one is exclusive.

10

00:00:40,510  -->  00:00:46,890
And so the method will never return a value of one and the value return is a double value.

11

00:00:46,890  -->  00:00:48,790
You can also see an example here.

12

00:00:49,230  -->  00:00:53,160
Here we want to generate a random integer between zero and five.

13

00:00:53,640  -->  00:01:00,600
So you would multiply Matt not random but w W5 and then caused the result to an end.

14

00:01:00,600  -->  00:01:04,120
For example if the method returns a random number zero point nine.

15

00:01:04,290  -->  00:01:08,790
Then on Monday playing with file the value would be 4.5.

16

00:01:08,790  -->  00:01:16,380
But when cast is applied the value 4.5 gets truncated before this recall for more typecasting discussion

17

00:01:16,680  -->  00:01:22,860
that when we cast a flawed r w an integer it will all this truncate the number.

18

00:01:22,860  -->  00:01:26,740
So in this case we wanted a random number between zero and five.

19

00:01:27,270  -->  00:01:33,250
And if you want a random number between 0 and then we would simply multiply Mad Dog random the WGAN

20

00:01:33,270  -->  00:01:34,130
.

21

00:01:34,620  -->  00:01:39,660
We will also use this method quite a bit in our project that we will implement after completing object

22

00:01:39,660  -->  00:01:42,900
oriented concepts.

23

00:01:42,900  -->  00:01:49,800
Next is the matter ABS which is an overloaded method that returns the absolute value of the argument

24

00:01:49,810  -->  00:01:50,320
.

25

00:01:50,850  -->  00:01:57,040
So if the argument is minus 240 as shown here then it would read in a positive to 40.

26

00:01:57,090  -->  00:02:02,430
Of course if the argument is already positive do then the return value would be same as the input argument

27

00:02:02,430  -->  00:02:04,590
.

28

00:02:04,590  -->  00:02:07,800
Next is that Rawn method as the name suggests.

29

00:02:07,920  -->  00:02:14,780
It basically advanced the input argument to the nearest long r and depending on the data type of the

30

00:02:14,790  -->  00:02:15,800
argument.

31

00:02:16,380  -->  00:02:22,320
So if argument is a double value then it gets thrown into the nearest long rally.

32

00:02:22,410  -->  00:02:27,990
For example here twenty four point eight is a double value and so it gets rounded to the nearest long

33

00:02:27,990  -->  00:02:30,130
value with just one defined.

34

00:02:30,510  -->  00:02:35,550
Hello what if argument is flawed then it gets thrown out the nearest interview.

35

00:02:35,790  -->  00:02:41,390
For example are twenty before want to file is a float value and it gets thrown into the nearest And

36

00:02:41,480  -->  00:02:43,020
with just one before.

37

00:02:43,650  -->  00:02:49,810
Basically double the 64 bits and so long as return as it is also 64 bits.

38

00:02:49,860  -->  00:02:51,160
Same happens with float.

39

00:02:51,180  -->  00:02:55,920
And both of which are represented in 32 bits.

40

00:02:56,430  -->  00:03:03,240
Next is the silly method it returns the smallest double that is greater than or equal to the argument

41

00:03:03,490  -->  00:03:03,830
.

42

00:03:04,120  -->  00:03:07,060
Another one should be equal to an integer.

43

00:03:07,170  -->  00:03:08,370
Here in this example.

44

00:03:08,490  -->  00:03:16,380
Input argument is 20.00 on and so the seen method would require the double value 21 so can do it.

45

00:03:16,440  -->  00:03:22,980
Here is the smallest double value that is greater than can be Point 1 undergoes equals an integer.

46

00:03:22,980  -->  00:03:27,180
Can you guess what it would get done if the argument is a double point B.

47

00:03:27,690  -->  00:03:35,460
It would be current itself as the definition is greater than or equal to the argument should be equal

48

00:03:35,460  -->  00:03:37,250
to an integer 2.

49

00:03:37,780  -->  00:03:45,770
OK next is the floor method which is opposite of sea floor it does the largest double.

50

00:03:45,810  -->  00:03:48,310
That is less than not equal to the argument.

51

00:03:48,690  -->  00:03:51,540
And it should also be equal to an integer.

52

00:03:51,540  -->  00:03:53,550
You can also see an example here.

53

00:03:54,150  -->  00:03:56,980
So both C and floor return a double value.

54

00:03:57,210  -->  00:04:03,810
Well-drawn method returns a long road and none of them and their names reflect what they are doing.

55

00:04:03,900  -->  00:04:09,860
If it is seen it means like a ceiling on say greater than or equal to will you believe it can.

56

00:04:10,380  -->  00:04:16,780
Well for float it means like bottom on a smaller or equal two value will be returned.

57

00:04:16,830  -->  00:04:17,620
Put it on.

58

00:04:17,670  -->  00:04:24,060
It will simply be rounded to the nearest integer value depending on the argument that is it can be either

59

00:04:24,060  -->  00:04:31,860
a value that is greater than the argument R.W. smaller than the argument next the overloaded min and

60

00:04:31,860  -->  00:04:39,510
max metrics which stick to arguments as the names imply dissimulated and minimum or maximum of the two

61

00:04:39,510  -->  00:04:41,790
numbers.

62

00:04:42,450  -->  00:04:47,230
Next a square root and square root of the argument as a double value.

63

00:04:47,910  -->  00:04:54,370
But if argument is something called nine or a negative number then a 9 would be returned.

64

00:04:54,930  -->  00:04:56,870
Nan stands for Not the number.

65

00:04:57,360  -->  00:05:02,260
And it implies something that is undefined or in other words meaningless.

66

00:05:02,490  -->  00:05:08,280
It is produced if a floating point operation has some input parameters which cause the operation to

67

00:05:08,290  -->  00:05:12,500
produce an undefined result in the case of square root.

68

00:05:12,510  -->  00:05:19,390
It can be a negative argument which is basically meaningless because it's a matter to return a man.

69

00:05:19,440  -->  00:05:25,590
Similarly if you do get a double value zero with another double value zero then we get a Nanna's output

70

00:05:25,600  -->  00:05:26,660
.

71

00:05:27,720  -->  00:05:32,640
Similarly there is a method for finding cube root and also there are few other commonly used matters

72

00:05:32,790  -->  00:05:36,680
related to logarithmic and parametric functions.

73

00:05:36,930  -->  00:05:41,390
So I think we covered some very common to use my dad's knowledge just very quickly.

74

00:05:41,500  -->  00:05:45,450
Yes some of them are there to be reviewed in my Eclipse already.

75

00:05:46,740  -->  00:05:50,510
OK let's just look is there and that would be generated.

76

00:05:50,850  -->  00:05:58,970
OK so let's have this statement and let's have a double zero which is divided by double zero discharge

77

00:05:58,980  -->  00:05:59,850
under demand.

78

00:05:59,850  -->  00:06:01,370
We discussed this earlier.

79

00:06:01,890  -->  00:06:04,290
So as you can see when I run it it prints none.

80

00:06:04,290  -->  00:06:06,350
So this expression is generating it.

81

00:06:06,360  -->  00:06:17,730
Man next Let's try my dark square root and for this effect give a negative number.

82

00:06:17,730  -->  00:06:20,010
It would also generate and 9.

83

00:06:20,190  -->  00:06:26,300
So an ironic X is not OK so it needs to be a positive value.

84

00:06:26,700  -->  00:06:29,840
Next let's test a random method.

85

00:06:30,330  -->  00:06:33,000
So let's gaster to and let's just try the same method.

86

00:06:33,070  -->  00:06:35,820
Same example that we have seen

87

00:06:38,940  -->  00:06:44,180
math dark ride numbers generates a number between 0 and 1.

88

00:06:44,580  -->  00:06:50,290
Since we want number between 0 and 5 so be multiplied with 5 and when we run it.

89

00:06:50,610  -->  00:06:53,320
So it's printing for let me run it once again.

90

00:06:53,430  -->  00:06:55,070
This time it is under-10 0.

91

00:06:55,230  -->  00:06:56,390
What I need one more time.

92

00:06:56,400  -->  00:06:57,550
It's generating 3.

93

00:06:57,870  -->  00:07:01,130
So that's the random number generator.

94

00:07:01,140  -->  00:07:03,000
Next let's try wrong.

95

00:07:03,360  -->  00:07:12,700
So let's say math wrong let's say twenty one point four 9 9 9.

96

00:07:12,810  -->  00:07:20,050
And since this is our diabolical Jondrette the nearest long and then nearest long will be 21.

97

00:07:20,230  -->  00:07:29,190
OK but if we make it one day 1.5 it should pretend to Google only to 22 and you can see it here.

98

00:07:29,690  -->  00:07:30,780
So that's what we have.

99

00:07:30,930  -->  00:07:33,940
Next let's try seal.

100

00:07:34,080  -->  00:07:40,560
So Matt Dotsie just know that all of these are static methods and so we are just accessing using the

101

00:07:40,590  -->  00:07:41,520
Glasman.

102

00:07:41,820  -->  00:07:44,740
So let's say twenty one point one.

103

00:07:45,030  -->  00:07:48,990
So this should generate a double 22 right.

104

00:07:48,990  -->  00:07:50,670
Since it's a sealed function.

105

00:07:50,670  -->  00:07:55,040
Now if we make it floor it will be 21.

106

00:07:55,830  -->  00:07:58,890
So you can see Prince 21 next.

107

00:07:58,950  -->  00:08:06,100
Let's just try the max function not Max and that is also a min.

108

00:08:06,120  -->  00:08:07,310
But let's just try.

109

00:08:07,360  -->  00:08:11,180
Mad Max defier.

110

00:08:11,550  -->  00:08:14,320
So this should bring to an defier.

111

00:08:14,430  -->  00:08:15,310
Here you go.

112

00:08:15,390  -->  00:08:16,300
So that's about it.

113

00:08:16,320  -->  00:08:20,010
So just go ahead and explode the Djala API.

114

00:08:20,100  -->  00:08:21,180
I look at the math class.

115

00:08:21,180  -->  00:08:27,250
It has many other methods so just go ahead and familiarize yourself with that and are some of them.

116

00:08:27,450  -->  00:08:28,830
And that's about it.

117

00:08:29,070  -->  00:08:29,910
And thank you
