3 ms·
It has to run on a computer. How would you simulate rational arithmetic?
by the_gorilla 2y ago
It has to run on a computer. How would you simulate rational arithmetic?
- mikequinlan 2y agoRational arithmetic represents numbers as a numerator and denominator (rational numbers). There are hundreds (at least) of libraries that implement rational arithmetic on a computer. https://www.google.com/search?q=rational+arithmetic+library https://www.google.com/search?q=rational+arithmetic+library
- the_gorilla 2y agoI meant run on the cpu itself. Most processors have floating-point support, and fixed-point just uses integer operations. All those heavy libraries require an arbitrary amount of memory for their calculations.
- dzaima 2y agoThe article here is about hardware without native FP already; that said, rationals (even before getting to the need of bigints) are quite bad regardless, likely requiring division & gcd around basic arith, which are slow both in software and in hardware.