PyArrow decimal types
When we looked at the Floating point types recipe earlier in this chapter, one of the important things we mentioned was that floating types are inexact. Most users of computer software can go their entire lives without knowing this fact, and in many cases, the lack of precision may be an acceptable trade-off to get the performance offered by floating point types. However, in some domains, it is critical to have extremely precise computations.
As a simplistic example, let’s assume that a movie recommender system used floating point arithmetic to calculate the rating for a given movie as 4.3334 out of 5 stars when it really should have been 4.33337. Even if that rounding error was repeated a million times, it probably wouldn’t have a largely negative effect on civilization. On the flip side, a financial system that processes billions of transactions per day would find this rounding error to be unacceptable. Over time, that rounding error would...