If you always want exact numerical results, this is inherently impossible to achieve, using computers or not. For example, what is the "exact" square root result of 2? The result is an irrational number, so it does not have an exact numerical representation . There are many other numbers like that, an infinite number actually. :) (There are even rational numbers of infinite size, which are the periodic tithe.)
Specifically for computers, even for rational numbers it is not always possible to obtain an "exact" numerical representation. Just think of a large number, for example 1234567890 [5 reps] . It is not possible to accurately represent this number in a
double variable of the C language, simply because it does not fit into a
double variable ...
As far as I know, there are (at least) three ways to partially circumvent the mathematical limitations of today's computers and languages.
The first way is to use a mathematical library of "infinite precision". These libraries are widely used today because they are required for computational encryption (mainly public-key cryptography, used in "secure connections" to
https:// sites). Obviously, these libraries continue to have limitations on the numerical representation of irrational numbers, but use a method for storing numbers that makes calculations possible with "big" numbers, such as 1234567890 [5 repetitions] that I cited above, or as 1024 or 2048-bit keys widely used in public key cryptography.
The second way is to work with fractional number library. In this way, it is possible to work naturally with periodic tithe and certain kinds of irrational numbers.
The other way is to work with symbolic math, where symbols are used for known irrational numbers, such as e, pi, etc. Usually some specific application is used, such as "Wolfram Mathematica" (and similar open source programs), or specific languages, such as (if I am not mistaken) R, Julia, etc. Of course there are also libraries for symbolic math for idioms like C, Python, etc., it's just a matter of looking.