運行下面的代碼: import matplotlib.pyplot as plt
import numpy as np
def xon (ton, t):
if ton <= t:
return (t-ton)/5
else:
return 0
vxon = np.vectorize(xon)
t = np.linspace(0, 49, 5
我一直在試圖重寫下面的代碼來總結浮點數,同時最小化舍入錯誤,但我發現在Rust中很難做到這一點。任何建議將不勝感激。我附上我的非工作鏽嘗試 def msum(iterable):
"Full precision summation using multiple floats for intermediate values"
# Rounded x+y stored in hi