|
SpECTRE
v2025.08.19
|
Compute the continued fraction representation of a number. More...
#include <FractionUtilities.hpp>
Public Types | |
| using | value_type = typename value_type_helper< T >::type |
| The decayed return type of T::numerator() for a fraction, int64_t for other types. | |
Public Member Functions | |
| ContinuedFraction (const T &value) | |
| value_type | operator* () const |
| Obtain the current element in the expansion. | |
| operator bool () const | |
| Check if the expansion is incomplete. If T is a fraction type this will be true until the full exact representation of the fraction is produced. If T is a floating point type this will be true until the estimated numerical error is larger than the remaining error in the representation. | |
| ContinuedFraction & | operator++ () |
| Advance to the next element in the expansion. | |
Compute the continued fraction representation of a number.
The template argument may be a fraction type or a floating point type. If the expansion is computed exactly then it will be the shorter of the expansions for the given value.