2021-04-02 23:31:54 +08:00
|
|
|
|
"""
|
2020-12-21 22:48:43 +08:00
|
|
|
|
writen by shenjackyuanjie
|
|
|
|
|
mail: 3695888@qq.com
|
2021-04-02 23:31:54 +08:00
|
|
|
|
"""
|
2020-12-21 22:48:43 +08:00
|
|
|
|
|
2021-01-25 17:11:16 +08:00
|
|
|
|
import decimal
|
2020-12-21 22:48:43 +08:00
|
|
|
|
|
2021-04-03 12:15:24 +08:00
|
|
|
|
import bin
|
|
|
|
|
|
2021-02-14 20:22:29 +08:00
|
|
|
|
A = [2.573, 3, ['m', 'kg'], ['N', 's']]
|
|
|
|
|
B = [2.45, -7, ['N', 'kg'], ['m', 's']]
|
|
|
|
|
C = [1.14, 5, ['m'], ['s']]
|
|
|
|
|
D = [1.419, -4, ['kg'], ['m']]
|
2020-12-21 22:48:43 +08:00
|
|
|
|
|
2021-02-14 20:22:29 +08:00
|
|
|
|
print('A = ', A)
|
|
|
|
|
print('B = ', B)
|
|
|
|
|
print('C = ', C)
|
|
|
|
|
print('D = ', D)
|
2020-12-21 22:48:43 +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-02-14 20:22:29 +08:00
|
|
|
|
print('A × B = ', a)
|
|
|
|
|
print('A ÷ B = ', b)
|
|
|
|
|
print('A × B ÷ B = ', c)
|
|
|
|
|
print('A ÷ B × B = ', d)
|
2020-12-27 22:42:55 +08:00
|
|
|
|
|
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-02-14 20:22:29 +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))
|