December 2016
Intermediate to advanced
332 pages
6h 2m
English
In the context of scientific computing, there is often the need of first making symbolic manipulations and then converting the symbolic result into a floating-point number .
The central tool for evaluating a symbolic expression is evalf. It converts symbolic expressions to floating-point numbers by using the following:
pi.evalf() # returns 3.14159265358979
The data type of the resulting object is Float (note the capitalization), which is a SymPy data type that allows floating-point numbers with an arbitrary number of digits (arbitrary precision).
The default precision corresponds to 15 digits, but it can be changed by giving evalf an extra positive integer argument specifying the desired precision in terms the numbers ...
Read now
Unlock full access