19#ifndef INCLUDED_TOOLS_FRACT_HXX
20#define INCLUDED_TOOLS_FRACT_HXX
33 sal_Int32 mnNumerator = 0;
34 sal_Int32 mnDenominator = 1;
41 Fraction(
double nNum,
double nDen );
42 Fraction( sal_Int64 nNum, sal_Int64 nDen );
46 typename std::enable_if<std::is_integral<T1>::value && std::is_integral<T2>::value,
int>::type = 0)
47 :
Fraction( sal_Int64(nNum), sal_Int64(nDen) ) {}
51 sal_Int32 GetNumerator()
const;
52 sal_Int32 GetDenominator()
const;
54 explicit operator sal_Int32()
const;
55#if SAL_TYPES_SIZEOFPOINTER == 8
58 explicit operator double()
const;
73 void ReduceInaccurate(
unsigned nSignificantBits );
79 size_t GetHashValue()
const;
112template<
typename charT,
typename traits>
113inline std::basic_ostream<charT, traits> &
operator <<(
114 std::basic_ostream<charT, traits> & rStream,
const Fraction& rFraction)
bool operator==(const BigInt &rVal1, const BigInt &rVal2)
bool operator<(const BigInt &rVal1, const BigInt &rVal2)
sal_Int32 GetNumerator() const
Fraction & operator/=(double v)
Fraction & operator=(const Fraction &rfrFrac)=default
Fraction & operator+=(double v)
Fraction & operator=(double v)
Fraction & operator*=(double v)
Fraction(Fraction &&rFrac)=default
Fraction & operator=(Fraction &&rfrFrac)=default
sal_Int32 GetDenominator() const
Fraction(T1 nNum, T2 nDen, typename std::enable_if< std::is_integral< T1 >::value &&std::is_integral< T2 >::value, int >::type=0)
Fraction(const Fraction &rFrac)=default
Fraction & operator-=(double v)
bool operator>(const Fraction &rVal1, const Fraction &rVal2)
TOOLS_DLLPUBLIC Fraction operator*(const Fraction &rVal1, const Fraction &rVal2)
TOOLS_DLLPUBLIC bool operator>=(const Fraction &rVal1, const Fraction &rVal2)
TOOLS_DLLPUBLIC Fraction operator-(const Fraction &rVal1, const Fraction &rVal2)
TOOLS_DLLPUBLIC bool operator<=(const Fraction &rVal1, const Fraction &rVal2)
TOOLS_DLLPUBLIC bool operator!=(const Fraction &rVal1, const Fraction &rVal2)
TOOLS_DLLPUBLIC Fraction operator+(const Fraction &rVal1, const Fraction &rVal2)
TOOLS_DLLPUBLIC Fraction operator/(const Fraction &rVal1, const Fraction &rVal2)
std::basic_ostream< charT, traits > & operator<<(std::basic_ostream< charT, traits > &rStream, const Fraction &rFraction)
timeval & operator-=(timeval &t1, const timeval &t2)
tools::Rectangle & operator+=(tools::Rectangle &rRect, const SvBorder &rBorder)
SmFace & operator*=(SmFace &rFace, const Fraction &rFrac)