數學不是我最擅長的,我是 python 新手。我需要幫助來理解以下公式:凈營運資本= MAX(總流動資產-超額現金-(總流動負債-(總債務-長期債務)),0)我不知道上面等式中的 MAX 是什么以及零是什么意思。根據我收集到的信息,函數 max(x,0) 被稱為實數 x 的正數部分。另外,是否可以在 python 中進行此計算?謝謝
1 回答

慕桂英4014372
TA貢獻1871條經驗 獲得超13個贊
max(x,0)意思是“返回其中最大的那個?!?在那里使用它以使凈營運資本永遠不會小于零,即 NWC 不能為負數。
在python中,這段代碼是:
def net_working_capital(
total_current_assets,
excess_cash,
total_current_liabilites,
total_debt,
long_term_debt
):
return max(total_current_assets - excess_cash - (total_current_liabilites - (total_debt - long_term_debt)), 0)
print(net_working_capital(10000, 1000, 1000, 1000, 1000))
# prints 8000
print(net_working_capital(0, 1000, 1000, 1000, 1000))
# prints 0
添加回答
舉報
0/150
提交
取消