Why do doubles and floats exist?
Duplicate
When should you use double instead of decimal?
.. and much more...
We use C # and SQL Server decimal data types in all our applications because of their precision. There have never been any of these annoying issues where the grand total doesn't add up to details etc.
I was wondering why double and float exist at all, given their imprecision
a source to share
Floating point arithmetic came about because it is the only way to deal with large numbers of non-integers at a reasonable amount of hardware overhead. Infinite precision arithmetic is implemented in multiple languages ββ(Python, LISP, etc.) and libraries (Java BigNum, GMP, etc.) and is an alternative for people who require more precision (e.g. in the financial industry). For most of us who are dealing with midsize numbers, floats
or of course,doubles
are more than accurate enough. Two different types of floating point data (which corresponds to IEEE 754 single and two point precision, respectively), since a single precision floating point block has much better area, power and speed properties than a double precision block, and therefore hardware designers and programmers must make appropriate trade-offs for the use of these various properties.
a source to share