-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
122 additions
and
4 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/**想法 | ||
* 将大数在进行表示时使用字符串进行表示,计算时转化成数组,进行计算。 | ||
*/ | ||
|
||
public class BigNum { | ||
private String value; | ||
|
||
//获取值 | ||
public String getValue() { | ||
return value; | ||
} | ||
|
||
//设置大数值 | ||
public void setValue(String val) { | ||
value = val; | ||
} | ||
|
||
//将大数字符串转化成字符数组 | ||
public char[] toArray() { | ||
char[] tArray = new StringBuffer(value).reverse().toString().toCharArray(); | ||
return tArray; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
public class Calc { | ||
private BigNum result; | ||
private BigNum remainder; | ||
|
||
public void add(BigNum a, BigNum b) { | ||
|
||
} | ||
|
||
public void sub(BigNum a, BigNum b) { | ||
|
||
} | ||
|
||
public void mul(BigNum a, BigNum b) { | ||
|
||
} | ||
|
||
public void div(BigNum a, BigNum b) { | ||
|
||
} | ||
} |