Пример #1
0
// FIXME: Make sure that zero has the same floating point
// semantics as x.
inline Real
operator-(Real const& x)
{
  Real zero;
  return zero - x.impl();
}
Пример #2
0
inline Real
operator*(Real const& a, Real const& b)
{
  return a.impl() * b.impl();
}
Пример #3
0
inline Real
operator/(Real const& a, Real const& b)
{
  return a.impl() / b.impl();
}
Пример #4
0
inline Real
operator-(Real const& a, Real const& b)
{
  return a.impl() - b.impl();
}
Пример #5
0
// Arithmetic
inline Real
operator+(Real const& a, Real const& b)
{
  return a.impl() + b.impl();
}
Пример #6
0
inline bool
operator>(Real const& a, Real const& b)
{
  return a.impl().compare(b.impl()) == llvm::APFloat::cmpGreaterThan;
}
Пример #7
0
// Ordering, defined for signed floating point values by default.
inline bool
operator<(Real const& a, Real const& b)
{
  return a.impl().compare(b.impl()) == llvm::APFloat::cmpLessThan;
}
Пример #8
0
// Equality comparison
// Returns true when the two floating point values have the same value.
inline bool
operator==(Real const& a, Real const& b)
{
  return a.impl().compare(b.impl()) == llvm::APFloat::cmpEqual;
}