Package de.hdm_stuttgart.sd1.math
Class Math
java.lang.Object
de.hdm_stuttgart.sd1.math.Math
Subset of functions from class Math
using power series expansions.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic double
exp
(double x) Approximating the natural exponential function by a finite number of terms using power series expansion.static void
setSeriesLimit
(int seriesLimit)
-
Constructor Details
-
Math
public Math()
-
-
Method Details
-
setSeriesLimit
- Parameters:
seriesLimit
- The last term's index of a power series to be included.
-
exp
Approximating the natural exponential function by a finite number of terms using power series expansion.
\[ \begin{aligned} e^x ={} & 1 + {x\over 1!} + {x^2\over 2!} + {x^3\over 3!} + \dots \\ ={} & \sum_{i = 0}^\infty {x^i\over i!} \end{aligned} \] A power series implementation has to be finite since an infinite number of terms requires infinite execution time. The number of terms to be considered can be set bysetSeriesLimit(int)
}- Parameters:
x
- The exponential's argument as in \( e^x \)- Returns:
- The value \( e^x \) itself.
-