-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMySqrtTest.java
More file actions
44 lines (38 loc) · 803 Bytes
/
MySqrtTest.java
File metadata and controls
44 lines (38 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import org.junit.Test;
public class MySqrtTest {
MySqrt solver = new MySqrt();
// @Test
public void test1(){
int x = 4;
int res = solver.mySqrt(x);
System.out.println(res);
// 2
}
// @Test
public void test2(){
int x = 8;
int res = solver.mySqrt(x);
System.out.println(res);
// 2
}
// @Test
public void test3(){
int x = 1;
int res = solver.mySqrt(x);
System.out.println(res);
// 1
}
@Test
public void test4(){
int x = 2147395599;
int res = solver.mySqrt(x);
System.out.println(res);
// 46339
}
// @Test
public void test(){
int n = 2147395599;
System.out.println(n*n);
// -837308191
}
}