pyoculus.utils.continued_fraction.expandcf
- pyoculus.utils.continued_fraction.expandcf(realnumber, n=100, thres=1e-12)
Expands a positive real number in its continued fraction.
- Parameters:
realnumber (float) – The positive real number to expand. An absolute value will be taken if negative.
n (int, optional) – The maximum number of terms in the expansion. Default to 100.
thres (float, optional) – The threshold to stop the expansion. Default to 1e-6.
- Returns:
A NumPy array containing the continued fraction expansion of the real number up to the nth term or until the threshold is met.
- Return type:
np.ndarray