SpECTRE  v2024.04.12
ContinuedFraction< T > Class Template Reference

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.
 
ContinuedFractionoperator++ ()
 Advance to the next element in the expansion.
 

Detailed Description

template<class T>
class ContinuedFraction< T >

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.


The documentation for this class was generated from the following file: