浮點數計算

 二進制和十進制轉換過程中,產生的誤差範例:

  • 0.1 + 0.2 = 0.30000000000000004
  • 100 / 3     = 33.333333333333336
    1/3 * 100 = 33.33333333333333

相關參考資料:

Comments

Popular posts from this blog

Alpha Camp 全端開發課程學習心得

在 javascript 用 regular expression 為金額加上千位數分隔符號

shop_platform - sqlalchemy.exc.TimeoutError