3 ms·
In Python there's SymPy. It simplifies expressions and then you can ask for the answer as a number to N decimal places. >>> from sympy import N, sqrt, pi
by shpx 7y ago
In Python there's SymPy. It simplifies expressions and then you can ask for the answer as a number to N decimal places.
>>> from sympy import N, sqrt, pi
>>> N(sqrt(2)*pi, 50)
4.4428829381583662470158809900606936986146216893757
https://docs.sympy.org/latest/modules/evalf.html https://docs.sympy.org/latest/modules/evalf.html
https://en.m.wikipedia.org/wiki/Computer_algebra https://en.m.wikipedia.org/wiki/Computer_algebra
- kccqzy 7y agoThat's a crude approximation of what Mathematica can do. Not all (in fact, very few) irrational numbers are computable. Yet among the computable numbers, what our computers can represent in any language is but a small subset of them. (Although computable numbers are equinumerous with the naturals.)
- black_knight 7y ago> Yet among the computable numbers, what our computers can > represent in any language is but a small subset of them. This is only true because of physical limitations of the machine (say, it has only finite memory). In the same way not all Turing machines cannot be implemented on actual computers. This is not a restriction of the languages we use. There is nothing stopping an actual programming language representing all computable real numbers. > (Although computable numbers are equinumerous with the naturals.) This is only true in classical mathematics. In constructive mathematics we are free to assume that all real numbers are computable (And hence, not equinumerous with the naturals, per cantor’s argument).