Effective Java: Avoid Float and Double If Exact Answers Are Required

Kyle Carter
CodeX
Published in
3 min readJun 26, 2021

--

Photo by Jeswin Thomas on Unsplash

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…

--

--

Kyle Carter
CodeX
Writer for

I'm a software architect that has a passion for software design and sharing with those around me.