3 ms·
tldr; use Decimal
by jwmoz 4y ago
tldr; use Decimal
- jacobsenscott 4y agoThe proper tldr is - understand how floating point works (you can represent a huge range of numbers with a lot of precision, but not perfect accuracy, and high performance), and then decide if it is the proper data type for your problem. For example setting the heading and velocity of a missile (85.623 degrees, 500.138 m/s (idk how fast missiles go) floats are great. It is impossible to steer on an exact course anyway due to wind, temperature, etc (I assume...) Storing the number of dollars in you savings account - us decimal or better yet integer (just count the pennies).
- kazinator 4y agoIEEE 64 bit double can represent a missile velocity of 85.6230000000000.