当前位置: 首页>>代码示例>>C++>>正文


C++ rounding::div_down方法代码示例

本文整理汇总了C++中typenamepolicies::rounding::div_down方法的典型用法代码示例。如果您正苦于以下问题:C++ rounding::div_down方法的具体用法?C++ rounding::div_down怎么用?C++ rounding::div_down使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在typenamepolicies::rounding的用法示例。


在下文中一共展示了rounding::div_down方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: I

template<class T, class Policies> inline
interval<T, Policies> div_zero_part2(const interval<T, Policies>& x,
                                     const interval<T, Policies>& y)
{
  // assert(::boost::numeric::interval_lib::user::is_neg(y.lower()) && ::boost::numeric::interval_lib::user::is_pos(y.upper()) && (div_zero_part1(x, y, b), b));
  typename Policies::rounding rnd;
  typedef interval<T, Policies> I;
  typedef typename Policies::checking checking;
  if (::boost::numeric::interval_lib::user::is_neg(x.upper()))
    return I(rnd.div_down(x.upper(), y.lower()), checking::pos_inf(), true);
  else
    return I(rnd.div_down(x.lower(), y.upper()), checking::pos_inf(), true);
}
开发者ID:ARK1988,项目名称:nupic.core,代码行数:13,代码来源:division.hpp

示例2: I

template<class T, class Policies> inline
interval<T, Policies> div_zero_part2(const interval<T, Policies>& x,
                                     const interval<T, Policies>& y)
{
    // assert(y.lower() < 0 && y.upper() > 0 && (div_zero_part1(x, y, b), b));
    typename Policies::rounding rnd;
    typedef interval<T, Policies> I;
    typedef typename I::checking checking;
    const T& inf = checking::inf();
    if (is_neg(x.upper()))
        return I(rnd.div_down(x.upper(), y.lower()), inf, true);
    else
        return I(rnd.div_down(x.lower(), y.upper()), inf, true);
}
开发者ID:Frankie-666,项目名称:xray-16,代码行数:14,代码来源:division.hpp

示例3: div

template<class I> inline
I div(const typename I::base_type& x, const typename I::base_type& y)
{
  typedef typename I::traits_type Policies;
  if (detail::test_input<typename I::base_type, Policies>(x, y) || user::is_zero(y))
    return I::empty();
  typename Policies::rounding rnd;
  return I(rnd.div_down(x, y), rnd.div_up(x, y), true);
}
开发者ID:ngzHappy,项目名称:cpc2,代码行数:9,代码来源:arith3.hpp

示例4: fmod

template<class T, class Policies> inline
interval<T, Policies> fmod(const interval<T, Policies>& x, const T& y)
{
  if (interval_lib::detail::test_input(x, y))
    return interval<T, Policies>::empty();
  typename Policies::rounding rnd;
  typedef typename interval_lib::unprotect<interval<T, Policies> >::type I;
  T n = rnd.int_down(rnd.div_down(x.lower(), y));
  return (const I&)x - n * I(y);
}
开发者ID:hackshields,项目名称:antivirus,代码行数:10,代码来源:arith2.hpp

示例5: empty

template<class T, class Policies> inline
interval<T, Policies> multiplicative_inverse(const interval<T, Policies>& x)
{
  typedef interval<T, Policies> I;
  if (detail::test_input(x))
    return I::empty();
  T one = static_cast<T>(1);
  typename Policies::rounding rnd;
  if (in_zero(x)) {
    typedef typename Policies::checking checking;
    if (!detail::is_zero(x.lower()))
      if (!detail::is_zero(x.upper()))
        return I::whole();
      else
        return I(-checking::inf(), rnd.div_up(one, x.lower()), true);
    else
      if (!detail::is_zero(x.upper()))
        return I(rnd.div_down(one, x.upper()), checking::inf(), true);
      else
        return I::empty();
  } else 
    return I(rnd.div_down(one, x.upper()), rnd.div_up(one, x.lower()), true);
}
开发者ID:hackshields,项目名称:antivirus,代码行数:23,代码来源:arith2.hpp


注:本文中的typenamepolicies::rounding::div_down方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。