Archive for January, 2021

Why you shouldn’t use decimals or floats when calculating values

I still see this happening often enough in other people’s software, that I thought it was worth writing a post about. When performing calculations in most languages, it’s always best to avoid using decimals or floats. Why is this? It’s imprecise and can result in in-accuracy, especially when dealing with lots of small numbers. To explain, natively computers can only store integers, but need some way of representing decimals. This Read More...