Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Windows 綜合教學 >> Windows 資訊

Excel 2007 驚現嚴重運算 Bug:850×77.1=100000,實際應為 65535

編輯:Windows 資訊

Excel 2007 存在嚴重浮點運算錯誤:850*77.1 顯示 100000,正確答案為 65535。並非個案,以下算式同樣錯誤回傳 100000:

  • =5.1*12850
  • =10.2*6425
  • =20.4*3212.5
  • =40.8*1606.25
  • =154.2*425
  • =212.5*308.4
  • =308.4*212.5
  • =425*154.2

錯誤特徵分析

  • 核心數值 65535(二進位 16 位全 1,無號整數最大值)疑似觸發邊界條件錯誤。
  • 所有錯誤算式至少包含一個一位小數數值。
  • 若錯誤結果置於 A1,A1+1→100001、A1*1→100000、A1/1→100000(皆錯);但 A1*2→131070(正確)、A1-1→65534(正確)、A1/2→32767.5(正確),表現極不一致。
錯誤示例 1
錯誤示例 2

版本差異與影響

Office 2000/XP/2003 均無此 Bug,屬 Excel 2007 獨有。微軟開發測試流程疏失顯而易見,嚴重損害專業工具公信力。

臨時因應

升級至 Office 2010 以降版本,或避免在 Excel 2007 中進行接近 65535 邊界的浮點運算。微軟後續已透過更新修復此問題。

Copyright © Windows教程網 All Rights Reserved