Exemple #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();
}
Exemple #2
0
inline Real
operator*(Real const& a, Real const& b)
{
  return a.impl() * b.impl();
}
Exemple #3
0
inline Real
operator/(Real const& a, Real const& b)
{
  return a.impl() / b.impl();
}
Exemple #4
0
inline Real
operator-(Real const& a, Real const& b)
{
  return a.impl() - b.impl();
}
Exemple #5
0
// Arithmetic
inline Real
operator+(Real const& a, Real const& b)
{
  return a.impl() + b.impl();
}
Exemple #6
0
inline bool
operator>(Real const& a, Real const& b)
{
  return a.impl().compare(b.impl()) == llvm::APFloat::cmpGreaterThan;
}
Exemple #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;
}
Exemple #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;
}