Skip to content

Commit dda5cb2

Browse files
committed
docs: update stdlib docs
1 parent ca8b323 commit dda5cb2

File tree

2 files changed

+36
-22
lines changed

2 files changed

+36
-22
lines changed

documentation/Standard-Lib.md

Lines changed: 34 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Standard Library Cheatsheet
66

7-
Last updated: Mon, 30 Dec 2019 12:04:13 GMT
7+
Last updated: Mon, 30 Dec 2019 13:42:21 GMT
88

99

1010
## Usage
@@ -23,20 +23,36 @@ Last updated: Mon, 30 Dec 2019 12:04:13 GMT
2323
| Wenyan | Javascript Equivalent |
2424
|---|---|
2525
| [`圓周率`](../lib/算經.wy#L166) | `Math.PI` |
26-
| [`正弦`](../lib/算經.wy#L460) | `Math.sin` |
27-
| [`餘弦`](../lib/算經.wy#L490) | `Math.cos` |
28-
| [`反正弦`](../lib/算經.wy#L498) | `Math.asin` |
29-
| [`反餘弦`](../lib/算經.wy#L525) | `Math.acos` |
30-
| [`正切`](../lib/算經.wy#L532) | `Math.tan` |
31-
| [`反正切`](../lib/算經.wy#L569) | `Math.atan` |
32-
| [`對數`](../lib/算經.wy#L656) | `Math.log` |
33-
| [``](../lib/算經.wy#L734) | `Math.pow` |
34-
| [`平方根`](../lib/算經.wy#L758) | `Math.sqrt` |
35-
| [`絕對`](../lib/算經.wy#L819) | `Math.abs` |
36-
| [`取頂`](../lib/算經.wy#L824) | `Math.ceil` |
37-
| [`取底`](../lib/算經.wy#L829) | `Math.floor` |
38-
| [`取整`](../lib/算經.wy#L844) | `Math.round` |
39-
| [`取整`](../lib/算經.wy#L858) | `Math.trunc` |
26+
| [`倍圓周率`](../lib/算經.wy#L169) | `Math.PI * 2` |
27+
| [`半圓周率`](../lib/算經.wy#L172) | `Math.PI / 2` |
28+
| [`四分圓周率`](../lib/算經.wy#L175) | `Math.PI / 4` |
29+
| [`自然常數`](../lib/算經.wy#L177) | `Math.E` |
30+
| [`歐拉常數`](../lib/算經.wy#L179) | `0.5772156649015329` |
31+
| [`黃金分割數`](../lib/算經.wy#L181) | `1.618033988749895` |
32+
| [`二之平方根`](../lib/算經.wy#L183) | `Math.SQRT2` |
33+
| [`二之對數`](../lib/算經.wy#L185) | `Math.LN2` |
34+
| [`十之對數`](../lib/算經.wy#L187) | `Math.LN10` |
35+
| [`不可算數乎`](../lib/算經.wy#L190) | `Number.isNaN` |
36+
| [`浮點移位`](../lib/算經.wy#L392) | `x * Math.pow(2, y), y is integer` |
37+
| [`析浮點數`](../lib/算經.wy#L428) | `N/A` |
38+
| [`正弦`](../lib/算經.wy#L472) | `Math.sin` |
39+
| [`餘弦`](../lib/算經.wy#L502) | `Math.cos` |
40+
| [`反正弦`](../lib/算經.wy#L510) | `Math.asin` |
41+
| [`反餘弦`](../lib/算經.wy#L537) | `Math.acos` |
42+
| [`正切`](../lib/算經.wy#L544) | `Math.tan` |
43+
| [`反正切`](../lib/算經.wy#L581) | `Math.atan` |
44+
| [`勾股求角`](../lib/算經.wy#L615) | `Math.atan2` |
45+
| [`勾股求弦`](../lib/算經.wy#L633) | `Math.hypot` |
46+
| [`對數`](../lib/算經.wy#L670) | `Math.log` |
47+
| [`指數`](../lib/算經.wy#L713) | `Math.exp` |
48+
| [``](../lib/算經.wy#L749) | `Math.pow` |
49+
| [`平方根`](../lib/算經.wy#L773) | `Math.sqrt` |
50+
| [`絕對`](../lib/算經.wy#L834) | `Math.abs` |
51+
| [`取頂`](../lib/算經.wy#L839) | `Math.ceil` |
52+
| [`取底`](../lib/算經.wy#L844) | `Math.floor` |
53+
| [`取整`](../lib/算經.wy#L859) | `Math.round, but rounded away from zero when the fractional part is exactly 0.5` |
54+
| [`捨餘`](../lib/算經.wy#L873) | `Math.trunc` |
55+
| [`正負`](../lib/算經.wy#L883) | `Math.sign` |
4056

4157
## [籌經](../lib/籌經.wy)
4258

@@ -66,13 +82,12 @@ This cheatsheet is generated direct from stdlibs. There are still a lot of funct
6682

6783
Add comments in the stdlib files (one line above the function/value), the format should look like this:
6884
```
69-
疏曰「「下溢。同犀之Math.floor也。」」
85+
疏曰「「餘弦。同犀之Math.cos也。」」
7086
```
7187

72-
After you fill the comments, you need to run
88+
After you fill the comments, you need to update the document by running
7389
```bash
7490
npm run docs:update
7591
```
76-
to update the document.
7792

78-
Then you can submit a pull request. Thank you!
93+
Check the output document out and submit a pull request. Thank you!

tools/stdlib_doc.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,12 @@ Add comments in the stdlib files (one line above the function/value), the format
3535
疏曰「「餘弦。同犀之Math.cos也。」」
3636
\`\`\`
3737
38-
After you fill the comments, you need to run
38+
After you fill the comments, you need to update the document by running
3939
\`\`\`bash
4040
npm run docs:update
4141
\`\`\`
42-
to update the document.
4342
44-
Then you can submit a pull request. Thank you!
43+
Check the output document out and submit a pull request. Thank you!
4544
`;
4645

4746
function escapeMarkdown(text) {

0 commit comments

Comments
 (0)