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


C++ precision函数代码示例

本文整理汇总了C++中precision函数的典型用法代码示例。如果您正苦于以下问题:C++ precision函数的具体用法?C++ precision怎么用?C++ precision使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: precision

 string asset::to_string()const {
    string result = fc::to_string(amount.value / precision());
    if( decimals() )
    {
       auto fract = amount.value % precision();
       result += "." + fc::to_string(precision() + fract).erase(0,1);
    }
    return result + " " + symbol_name();
 }
开发者ID:Bitcoinsulting,项目名称:steem,代码行数:9,代码来源:asset.cpp

示例2: format

bool QgsRendererRangeV2LabelFormat::operator==( const QgsRendererRangeV2LabelFormat &other ) const
{
  return
    format() == other.format() &&
    precision() == other.precision() &&
    trimTrailingZeroes() == other.trimTrailingZeroes();
}
开发者ID:Margaral,项目名称:QGIS,代码行数:7,代码来源:qgsgraduatedsymbolrendererv2.cpp

示例3: _t2

/* encode contiguous floating-point block */
uint
_t2(zfp_encode_block, Scalar, DIMS)(zfp_stream* zfp, const Scalar* fblock)
{
  /* compute maximum exponent */
  int emax = _t1(exponent_block, Scalar)(fblock, BLOCK_SIZE);
  int maxprec = precision(emax, zfp->maxprec, zfp->minexp, DIMS);
  uint e = maxprec ? emax + EBIAS : 0;
  /* encode block only if biased exponent is nonzero */
  if (e) {
    cache_align_(Int iblock[BLOCK_SIZE]);
    /* encode common exponent; LSB indicates that exponent is nonzero */
    int ebits = EBITS + 1;
    stream_write_bits(zfp->stream, 2 * e + 1, ebits);
    /* perform forward block-floating-point transform */
    _t1(fwd_cast, Scalar)(iblock, fblock, BLOCK_SIZE, emax);
    /* encode integer block */
    return ebits + _t2(encode_block, Int, DIMS)(zfp->stream, zfp->minbits - ebits, zfp->maxbits - ebits, maxprec, iblock);
  }
  else {
    /* write single zero-bit to indicate that all values are zero */
    stream_write_bit(zfp->stream, 0);
    if (zfp->minbits > 1) {
      stream_pad(zfp->stream, zfp->minbits - 1);
      return zfp->minbits;
    }
    else
      return 1;
  }
}
开发者ID:Kitware,项目名称:VTK,代码行数:30,代码来源:encodef.c

示例4: MessageHandler_

 MessageHandler_()
         : std::ostream(new Buf(*this)), indent(indentLevel * INDENT_SIZE),
           beginLine(0), stepCount(0) {
     flags(os.flags());
     precision(os.precision());
     width(os.width());
 }
开发者ID:an3iitho,项目名称:graphillion,代码行数:7,代码来源:MessageHandler.hpp

示例5: non_clean_card_iterate_parallel_work

void CardTableModRefBSForCTRS::non_clean_card_iterate_possibly_parallel(
  Space* sp,
  MemRegion mr,
  OopsInGenClosure* cl,
  CardTableRS* ct,
  uint n_threads)
{
  if (!mr.is_empty()) {
    if (n_threads > 0) {
#if INCLUDE_ALL_GCS
      non_clean_card_iterate_parallel_work(sp, mr, cl, ct, n_threads);
#else  // INCLUDE_ALL_GCS
      fatal("Parallel gc not supported here.");
#endif // INCLUDE_ALL_GCS
    } else {
      // clear_cl finds contiguous dirty ranges of cards to process and clear.

      // This is the single-threaded version used by DefNew.
      const bool parallel = false;

      DirtyCardToOopClosure* dcto_cl = sp->new_dcto_cl(cl, precision(), cl->gen_boundary(), parallel);
      ClearNoncleanCardWrapper clear_cl(dcto_cl, ct, parallel);

      clear_cl.do_MemRegion(mr);
    }
  }
}
开发者ID:benbenolson,项目名称:hotspot_9_mc,代码行数:27,代码来源:cardTableModRefBSForCTRS.cpp

示例6: precision

double ConfusionMatrix::fscore(int category) {
  double p = precision(category);
  double r = recall(category);
  if((p + r) == 0.0)
    return 0.0;
  return (2 * p * r) / (p + r);
}
开发者ID:willcannings,项目名称:quarry,代码行数:7,代码来源:confusion_matrix.cpp

示例7: AplusLabelOut

AplusFuncLabel::AplusFuncLabel(A a_, AplusLabelOut *alo_) : AplusLabelOut()
{
  if (alo_!=0 && alo_->outFunc()!=0)
   {
     outFunc(alo_->outFunc());
     v(alo_->v());
   }

  if (alo_!=0 && alo_->format()!=AplusFormatter::BadFormat)
   {
     format(alo_->format());
     precision(alo_->precision());
   }

  if (verify(a_)==MSTrue)
   {
     a((A) ic(a_));
   }
  else
   {
     MSStringVector emptyStringVector;
     a((A)0);
     tick((A)0);
     grid((A)0);
     value((A)0);
     labels(emptyStringVector);
   }
}
开发者ID:PlanetAPL,项目名称:a-plus,代码行数:28,代码来源:AplusLabelOut.C

示例8: operator

 // network specific types
 int operator()(Layout_type const* t)
 {
   int n = 0;
   for (Decl* d : t->declaration()->fields())
     n += precision(d->type());
   return n;
 }
开发者ID:thehexia,项目名称:steve,代码行数:8,代码来源:length.cpp

示例9: ft_putloo

void		ft_putloo(va_list ap)
{
	char				*str;

	if ((g_trait & OPT_J) == OPT_J)
		str = ft_putjo(ap);
	else if (g_trait & OPT_Z)
		str = ft_putzo(ap);
	else if ((g_trait & OPT_LL) == OPT_LL)
		str = ft_putllo(ap);
	else if ((g_trait & OPT_L) == OPT_L)
		str = ft_putlo(ap);
	else if ((g_trait & OPT_HH) == OPT_HH)
		str = ft_puthho(ap);
	else if ((g_trait & OPT_H) == OPT_H)
		str = ft_putho(ap);
	else
		str = ft_putosf(ap);
	str = precision(str, 8);
	if (ft_strcmp(str, "") == 0 && g_trait & OPT_DIESE)
		str = ft_strdup("0");
	str = treat_o(str);
	g_print += ft_strlen(str);
	ft_putstr_fd(str, g_fd);
	free(str);
}
开发者ID:ThomasSan,项目名称:42sh,代码行数:26,代码来源:o_fct.c

示例10: bounds

void CLabHorizScale::drawScale(CDC *pDC)
{
   int tickLength;
   
   CRgn rgn;
   CRect rect = bounds();
   rgn.CreateRectRgn(rect.left, rect.top, rect.right, rect.bottom);
   pDC->SelectClipRgn(&rgn);
      
   for(double x=getTickMin(); x<=maximum(); x=x+tickIncrement())
   {
      double temp = x/(majorTickFrequency()*tickIncrement());
      if(temp == ceil(temp))
         tickLength = 7;
      else
         tickLength = 3;


      pDC->MoveTo(translateCoordinate(x), rect.top);
      pDC->LineTo(translateCoordinate(x), rect.top + tickLength);

      temp = x/(tickMarkFrequency() * tickIncrement());
      if(temp == ceil(temp))
      {
         CString tickMarkStr;
         tickMarkStr.Format("%.*f", precision(), x);
         
         pDC->TextOut(translateCoordinate(x) - _parent->getCharWidth() * tickMarkStr.GetLength()/2, 
                      rect.top + 7 /* _parent->getCharHeight()*/, 
                      tickMarkStr);

      }
   }
}
开发者ID:fville,项目名称:MFCLabWidget,代码行数:34,代码来源:LabHorizScale.cpp

示例11: MessageHandler_

 MessageHandler_()
         : std::ostream(&buf), buf(*this), indent(indentLevel * INDENT_SIZE),
           beginLine(0), totalSteps(0), stepCount(0),
           dotCount(0), dotTime(0), stepping(false) {
     flags(os.flags());
     precision(os.precision());
     width(os.width());
 }
开发者ID:K-Sonoda,项目名称:graphillion,代码行数:8,代码来源:MessageHandler.hpp

示例12: Asset

 model::AssetResponse PbQueryResponseFactory::deserializeAssetResponse(
     const protocol::AssetResponse &response) const {
   model::AssetResponse res;
   auto asset = response.asset();
   res.asset =
       Asset(asset.asset_id(), asset.domain_id(), asset.precision());
   return res;
 }
开发者ID:kevinmcmahon,项目名称:iroha,代码行数:8,代码来源:pb_query_response_factory.cpp

示例13: precision

double CoverMetrics::f1score() const {
    double p = precision();
    double r = recall();
    if (p + r < std::numeric_limits<double>::epsilon()) {
        return std::sqrt(-1); // return NaN
    }
    return 2*p*r/(p + r);
}
开发者ID:estnltk,项目名称:pfe,代码行数:8,代码来源:CoverMetrics.cpp

示例14: copyfmt

 basic_ios& copyfmt(const ios& right) {
     fill(right.fill());
     flags(right.flags() );
     exceptions(right.exceptions());
     width(right.width());
     precision(right.precision());
     return *this;
 }
开发者ID:ALuehmann,项目名称:labstreaminglayer,代码行数:8,代码来源:workarounds_gcc-2_95.hpp

示例15: toString

 /**
  * Stringify the data.
  * @return the content of asset.
  */
 std::string toString() const override {
   return detail::PrettyStringBuilder()
       .init("Asset")
       .append("assetId", assetId())
       .append("domainId", domainId())
       .append("precision", std::to_string(precision()))
       .finalize();
 }
开发者ID:kevinmcmahon,项目名称:iroha,代码行数:12,代码来源:asset.hpp


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