示例#1
0
文件: real.hpp 项目: Jenny-fa/lingo
// 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
文件: real.hpp 项目: Jenny-fa/lingo
inline Real
operator*(Real const& a, Real const& b)
{
  return a.impl() * b.impl();
}
示例#3
0
文件: real.hpp 项目: Jenny-fa/lingo
inline Real
operator/(Real const& a, Real const& b)
{
  return a.impl() / b.impl();
}
示例#4
0
文件: real.hpp 项目: Jenny-fa/lingo
inline Real
operator-(Real const& a, Real const& b)
{
  return a.impl() - b.impl();
}
示例#5
0
文件: real.hpp 项目: Jenny-fa/lingo
// Arithmetic
inline Real
operator+(Real const& a, Real const& b)
{
  return a.impl() + b.impl();
}
示例#6
0
文件: real.hpp 项目: Jenny-fa/lingo
inline bool
operator>(Real const& a, Real const& b)
{
  return a.impl().compare(b.impl()) == llvm::APFloat::cmpGreaterThan;
}
示例#7
0
文件: real.hpp 项目: Jenny-fa/lingo
// 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
文件: real.hpp 项目: Jenny-fa/lingo
// 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;
}