Skip to content

Commit 2ebecff

Browse files
更新文档 (#16)
* Update README.md
1 parent 31cf9eb commit 2ebecff

File tree

2 files changed

+46
-1
lines changed

2 files changed

+46
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ can add it to your maven project, or you can download it from Releases and manua
2929
<dependency>
3030
<groupId>io.github.BeardedManZhao</groupId>
3131
<artifactId>algorithmStar</artifactId>
32-
<version>1.27</version>
32+
<version>1.28</version>
3333
</dependency>
3434
</dependencies>
3535
```

src_code/README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,51 @@
1313
```java
1414
package zhao.algorithmMagic;
1515

16+
import zhao.algorithmMagic.core.AlgorithmStar;
17+
import zhao.algorithmMagic.core.FractionFactory;
18+
import zhao.algorithmMagic.operands.fraction.Fraction;
19+
20+
public class MAIN1 {
21+
public static void main(String[] args) {
22+
// 获取分数操作数工厂
23+
final FractionFactory fractionFactory = AlgorithmStar.fractionFactory();
24+
// 准备三个操作数
25+
final Fraction parse1 = fractionFactory.parse(1, 2);
26+
final Fraction parse2 = fractionFactory.parse(2);
27+
final Fraction parse3 = fractionFactory.parse("1 / 2");
28+
29+
System.out.println("打印三个分数");
30+
System.out.println(parse1);
31+
System.out.println(parse2);
32+
System.out.println(parse3);
33+
34+
System.out.println("全部通分 分别将分母变为 10 5 1 在这里我们将第一个分数保存一下 稍后用于约分");
35+
final Fraction cf1 = parse1.cf(10);
36+
System.out.println(cf1);
37+
System.out.println(parse2.cf(5));
38+
System.out.println(parse3.cf(1));
39+
40+
System.out.println("将被通分的 cf1 进行约分 不出意外的话 这里打印的值为 1 / 2");
41+
System.out.println(cf1.simplify());
42+
43+
System.out.println("在这里将 parse1 以及 parse2 进行加减乘除计算");
44+
System.out.println(parse1.add(parse2));
45+
System.out.println(parse1.diff(parse2));
46+
System.out.println(parse1.multiply(parse2));
47+
System.out.println(parse1.divide(parse2));
48+
49+
System.out.println("在这里将 parse1 做为Java中的数值类型进行使用");
50+
System.out.println(parse1.doubleValue());
51+
}
52+
}
53+
```
54+
55+
* To obtain new help information, you can directly obtain the help document through the following methods, which
56+
includes more comprehensive API instructions
57+
58+
```java
59+
package zhao.algorithmMagic;
60+
1661
import zhao.algorithmMagic.core.AlgorithmStar;
1762
import zhao.algorithmMagic.core.HelpFactory;
1863

0 commit comments

Comments
 (0)