Floating Point Numerics for Games and Simulations
English | 2025 | ISBN: 1032933550 | 230 Pages | PDF (True) | 30 MB
English | 2025 | ISBN: 1032933550 | 230 Pages | PDF (True) | 30 MB
Floating point is ubiquitous in computers, where it is the default way to represent non-integer numbers. However, few people understand it. We all see weird behavior sometimes, and many programmers treat it as a mystical and imprecise system of math that just works until it sometimes doesn’t. We hear that we shouldn’t trust floating point with money, we know that 0.1 + 0.2 does not equal 0.3, and “NaN” shows up in our logs when things break. We rarely hear why any of this is the case, and less about what to do about it.