Effective Java: Avoid Float and Double If Exact Answers Are Required
Published in
3 min readJun 26, 2021
This chapter dives into a fun computer science based topic. When we have a need to represent numbers that include a decimal point we will often reach for either a float
or a double
. These primitive types facilitate the representations of approximate floating point values over various magnitudes. A key part of the previous sentence is that it's an approximation. We must not…