When should I use double instead of decimal?

后端 未结 12 1769
Happy的楠姐
Happy的楠姐 2020-11-22 10:51

I can name three advantages to using double (or float) instead of decimal:

  1. Uses less memory.
  2. Faster because flo
12条回答
  •  广开言路
    2020-11-22 11:44

    Choose the type in function of your application. If you need precision like in financial analysis, you have answered your question. But if your application can settle with an estimate your ok with double.

    Is your application in need of a fast calculation or will he have all the time in the world to give you an answer? It really depends on the type of application.

    Graphic hungry? float or double is enough. Financial data analysis, meteor striking a planet kind of precision ? Those would need a bit of precision :)

提交回复
热议问题