Difficult-Rocket/tests/test.py

40 lines
715 B
Python
Raw Normal View History

2020-12-21 22:48:43 +08:00
"""
writen by shenjackyuanjie
mail: 3695888@qq.com
"""
2021-01-24 18:26:56 +08:00
import bin
2021-01-25 17:11:16 +08:00
import decimal
2020-12-21 22:48:43 +08:00
A = [2.573, 3, ["m", "kg"], ["N", "s"]]
2020-12-23 23:10:17 +08:00
B = [2.45, -7, ["N", "kg"], ["m", "s"]]
2020-12-27 22:42:55 +08:00
C = [1.14, 5, ["m"], ["s"]]
D = [1.419, -4, ["kg"], ["m"]]
2020-12-21 22:48:43 +08:00
2021-01-24 18:26:56 +08:00
print("A = ", A)
print("B = ", B)
print("C = ", C)
print("D = ", D)
2020-12-21 22:48:43 +08:00
2021-01-25 17:11:16 +08:00
2021-01-24 18:26:56 +08:00
a = bin.tools.S_N_M(A, B)
b = bin.tools.S_N_D(A, B)
c = bin.tools.S_N_M(b, B)
d = bin.tools.S_N_D(a, B)
2020-12-22 06:36:02 +08:00
2021-01-24 18:26:56 +08:00
print("A × B = ", a)
print("A ÷ B = ", b)
2020-12-27 22:42:55 +08:00
print("A × B ÷ B = ", c)
print("A ÷ B × B = ", d)
2021-01-24 18:26:56 +08:00
e = bin.tools.S_N_M(A, B, C, D)
f = bin.tools.S_N_M(A, bin.tools.S_N_M(B, bin.tools.S_N_M(C, D)))
2021-01-01 11:02:44 +08:00
2021-01-24 18:26:56 +08:00
print("A * B * C * D = ", e)
print("A * B * C * D = ", f)
2021-01-25 17:11:16 +08:00
e = decimal.Decimal('0.1')
f = 0.1
print(type(e), type(f))