Verovio
Source code documentation
vrv::Fraction Class Reference

Public Member Functions

 Fraction (int num=0)
 
 Fraction (int num, int denom)
 
 Fraction (data_DURATION duration)
 
template<typename T , typename = std::enable_if_t<std::is_same_v<T, int>>>
 Fraction (T num)
 
Fraction operator+ (const Fraction &other) const
 Addition operator.
 
Fraction operator- (const Fraction &other) const
 Subtraction operator.
 
Fraction operator* (const Fraction &other) const
 Multiplication operator.
 
Fraction operator/ (const Fraction &other) const
 Division operator.
 
Fraction operator% (const Fraction &other) const
 Modulo operator.
 
bool operator== (const Fraction &other) const
 Equality operator.
 
std::strong_ordering operator (const Fraction &other) const
 Ordering operator.
 
int GetNumerator () const
 Getters.
 
int GetDenominator () const
 
double ToDouble () const
 Convert fraction to a double.
 
std::string ToString () const
 Convert fraction to a string.
 
std::pair< data_DURATION, FractionToDur () const
 Convert to data_DURATION and the remaining Fraction.
 

Static Public Member Functions

static void Reduce (int &numerator, int &denominator)
 Reduce the fraction represented by the two numbers.
 

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