Esempio n. 1
0
	SPRIG_INLINE IntType rational_arrange_factor(
		boost::rational<IntType> const& v,
		IntType const& n = 10
		)
	{
		return rational_detail::rational_arrange_factor_impl<IntType>(v.denominator(), n, 1);
	}
Esempio n. 2
0
	SPRIG_INLINE To rational_cast(boost::rational<IntType> const& from, Converter conv) {
		return conv(from.numerator()) / conv(from.denominator());
	}
Esempio n. 3
0
	SPRIG_INLINE To rational_converter_cast(boost::rational<IntType> const& from) {
		return sprig::converter_cast<Tag, To>(from.numerator()) / sprig::converter_cast<Tag, To>(from.denominator());
	}
 static boost::rational<I> from(boost::rational<I2> x) { return boost::rational<I>(x.numerator(), x.denominator());}