7 #if !defined(CNL_IMPL_FRACTION_CTORS_H)
8 #define CNL_IMPL_FRACTION_CTORS_H
10 #include "../../integer.h"
11 #include "make_fraction.h"
13 #include "definition.h"
19 template<fixed_po
int Numerator, fixed_po
int Denominator>
20 constexpr fraction<Numerator, Denominator>::fraction(Numerator n, Denominator d)
26 template<fixed_po
int Numerator, fixed_po
int Denominator>
27 template<
integer Integer>
28 constexpr fraction<Numerator, Denominator>::fraction(Integer
const& i)
29 : fraction(static_cast<Numerator>(i), 1)
33 template<fixed_po
int Numerator, fixed_po
int Denominator>
34 template<fixed_po
int RhsNumerator, fixed_po
int RhsDenominator>
35 constexpr fraction<Numerator, Denominator>::fraction(
36 fraction<RhsNumerator, RhsDenominator>
const& f)
37 : fraction(static_cast<Numerator>(f.numerator), static_cast<Numerator>(f.denominator))
41 template<fixed_po
int Numerator, fixed_po
int Denominator>
42 template<std::
floating_po
int FloatingPo
int>
43 constexpr fraction<Numerator, Denominator>::fraction(FloatingPoint d)
44 : fraction(_impl::make_fraction<Numerator, Denominator>(d))
49 #endif // CNL_IMPL_FRACTION_CTORS_H