As I look further, it appears that standard Python libs such as float or decimal.Decimal do not provide exact representation of rational numbers (fractions) without potential loss of precision. Seems ‘fraction’ package yield exact results because those functions directly work on fractions (to my limited understanding).
decimal.Decimal is better than float, but it only extends to arbitrary precision decimal arithmetic, not exact representation of rational numbers. Given that these libraries could potentially serve as dependencies for tensor-related packages and beyond, should we consider bringing 'fraction' or restrict ourselves to float (which is a fallback in moarchiving if fraction unavailable)? I’m leaning towards fractions because it ensures exact fraction representation without the issues of rounding in numbers. What do you all think? Cheers!