Skip to content

Commit f7105c3

Browse files
committed
【添加】math example
1 parent 75b7680 commit f7105c3

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

examples/basic/math_example.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import math
2+
3+
print(math.e)
4+
print(math.pi)
5+
print(math.sqrt(9))
6+
print(math.pow(2, 3))
7+
print(math.exp(2))
8+
print(math.log(10))
9+
print(math.log2(8))
10+
print(math.log10(10))
11+
print(math.radians(60))
12+
print(math.radians(60))
13+
print(math.sin(math.radians(90)))
14+
print(math.cos(math.radians(60)))
15+
print(math.tan(math.radians(60)))
16+
print(math.asin(0.5))
17+
print(math.ceil(5.6454))
18+
print(math.floor(2.99))
19+
print(math.floor(-2.34))
20+
print(math.fabs(-5))
21+
print(math.fabs(5.0))
22+
print(math.fmod(4, 5))
23+
print(math.trunc(5.12))
24+
print(math.trunc(-6.8))
25+
print(math.gamma(5.21))
26+
print(math.lgamma(5.21))

0 commit comments

Comments
 (0)