Update P_C.py
This commit is contained in:
parent
d573f98ddd
commit
6a02b2fa64
21
libs/P_C.py
21
libs/P_C.py
@ -18,17 +18,12 @@ def P_C_M(A, B): # stand for Physics Calculation multiple
|
|||||||
if Float >= 10:
|
if Float >= 10:
|
||||||
Float /= 10
|
Float /= 10
|
||||||
Int += 1
|
Int += 1
|
||||||
elif Float <= 0.01:
|
elif Float <= 1:
|
||||||
Float *= 10
|
Float *= 10
|
||||||
Int -= 1
|
Int -= 1
|
||||||
else:
|
else:
|
||||||
pass
|
pass
|
||||||
Unit1, Unit2 = A[2] + B[2], []
|
Unit1, Unit2 = A[2] + B[2], A[3] + B[3]
|
||||||
for unit in B[3]:
|
|
||||||
if unit in Unit1:
|
|
||||||
Unit1.remove(unit)
|
|
||||||
else:
|
|
||||||
Unit2.append(unit)
|
|
||||||
if Unit1 == None:
|
if Unit1 == None:
|
||||||
Unit1 = []
|
Unit1 = []
|
||||||
for unit in Unit2:
|
for unit in Unit2:
|
||||||
@ -36,7 +31,7 @@ def P_C_M(A, B): # stand for Physics Calculation multiple
|
|||||||
Unit1.remove(unit)
|
Unit1.remove(unit)
|
||||||
Unit2.remove(unit)
|
Unit2.remove(unit)
|
||||||
else:
|
else:
|
||||||
pass
|
continue
|
||||||
C = [Float, Int, Unit1, Unit2]
|
C = [Float, Int, Unit1, Unit2]
|
||||||
return C
|
return C
|
||||||
|
|
||||||
@ -46,7 +41,6 @@ def P_C_D(A, B): # stand for Physics Calculation divide
|
|||||||
formats:
|
formats:
|
||||||
A & B list format:docs.basic_config.json:basic_number
|
A & B list format:docs.basic_config.json:basic_number
|
||||||
"""
|
"""
|
||||||
B[2], B[3] = B[3], B[2]
|
|
||||||
C = [0.0, 1, [], []]
|
C = [0.0, 1, [], []]
|
||||||
Float = float(A[0] / B[0])
|
Float = float(A[0] / B[0])
|
||||||
Int = int(A[1] - B[1])
|
Int = int(A[1] - B[1])
|
||||||
@ -58,12 +52,7 @@ def P_C_D(A, B): # stand for Physics Calculation divide
|
|||||||
Int -= 1
|
Int -= 1
|
||||||
else:
|
else:
|
||||||
pass
|
pass
|
||||||
Unit1, Unit2 = A[2] + B[2], []
|
Unit1, Unit2 = A[2] + B[3], A[3] + B[2]
|
||||||
for unit in B[3]:
|
|
||||||
if unit in Unit1:
|
|
||||||
Unit1.remove(unit)
|
|
||||||
else:
|
|
||||||
Unit2.append(unit)
|
|
||||||
if Unit1 == None:
|
if Unit1 == None:
|
||||||
Unit1 = []
|
Unit1 = []
|
||||||
for unit in Unit2:
|
for unit in Unit2:
|
||||||
@ -71,6 +60,6 @@ def P_C_D(A, B): # stand for Physics Calculation divide
|
|||||||
Unit1.remove(unit)
|
Unit1.remove(unit)
|
||||||
Unit2.remove(unit)
|
Unit2.remove(unit)
|
||||||
else:
|
else:
|
||||||
pass
|
continue
|
||||||
C = [Float, Int, Unit1, Unit2]
|
C = [Float, Int, Unit1, Unit2]
|
||||||
return C
|
return C
|
||||||
|
Loading…
Reference in New Issue
Block a user