• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ Number函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: dsyslog

void cChannel::SetId(int Nid, int Tid, int Sid, int Rid)
{
  if (nid != Nid || tid != Tid || sid != Sid || rid != Rid) {
     if (Number()) {
        dsyslog("changing id of channel %d from %d-%d-%d-%d to %d-%d-%d-%d", Number(), nid, tid, sid, rid, Nid, Tid, Sid, Rid);
        modification |= CHANNELMOD_ID;
        Channels.SetModified();
        Channels.UnhashChannel(this);
        }
     nid = Nid;
     tid = Tid;
     sid = Sid;
     rid = Rid;
     if (Number())
        Channels.HashChannel(this);
     schedule = NULL;
     }
}
开发者ID:Lexus34,项目名称:tdt-arp,代码行数:18,代码来源:channels.c


示例2: notEqual

Number notEqual(Number a,Number b){
	Number result;
	result = equal(a,b);
	if (result==Number(1,1))
		result.setValue(0,1);
	else
		result.setValue(1,1);
	return result;
}
开发者ID:ozeron,项目名称:Calculator,代码行数:9,代码来源:Data.cpp


示例3: dsyslog

void cChannel::SetCaDescriptors(int Level)
{
  if (Level > 0) {
     modification |= CHANNELMOD_CA;
     Channels.SetModified();
     if (Level > 1)
        dsyslog("changing ca descriptors of channel %d", Number());
     }
}
开发者ID:BackupTheBerlios,项目名称:macvdr-svn,代码行数:9,代码来源:channels.c


示例4: HAL_SPI_TxRxCpltCallback

extern "C" void HAL_SPI_TxRxCpltCallback(SPI_HandleTypeDef *hspi)
{
    for (int i = 0; i < Number(spiMap); i++) {
        if (spiMap[i] && &spiMap[i]->_spi == hspi) {
            spiMap[i]->txrxComplete();
            break;
        }
    }
}
开发者ID:jaggies,项目名称:matchbox,代码行数:9,代码来源:spi.cpp


示例5: match

void Parser::single_group() {
    match(GROUP);
    string num = tokens[look].value;
    match(NUM);
    match(AS);
    string id = tokens[look].value;;
    match(ID);
    groups.push_back(Number(num));
    col_names.push_back(id);
}
开发者ID:blacider,项目名称:compiler,代码行数:10,代码来源:Parser.cpp


示例6: ev_parsedesc

void ev_parsedesc(at *desc)
{
   if (CONSP(desc)) {
      ev_parsedesc(Car(desc));
      ev_parsedesc(Cdr(desc));
   } else if (GPTRP(desc))
      evdesc = (const char *)String(desc);
   else if (NUMBERP(desc))
      evmods = (unsigned char)Number(desc);
}
开发者ID:barak,项目名称:lush,代码行数:10,代码来源:event.c


示例7: FailureWeaponJammed

void FailureWeaponJammed(MECH * mech, int weapnum, int weaptype,
						 int section, int critical, int roll, int *modifier,
						 int *type)
{
	SetPartTempNuke(mech, section, critical, failures[Conv(mech, section,
														   critical) +
													  roll].type);
	*type = WEAPON_JAMMED;
	SetRecyclePart(mech, section, critical, Number(20, 40));
}
开发者ID:chazu,项目名称:btmux,代码行数:10,代码来源:failures.c


示例8: push_operation_result

void Subtraction::push_operation_result(Interpreter &interpreter, const PElement &_x, const PElement &_y)
{
	try {
		const Number &x = dynamic_cast<const Number &>(_x);
		const Number &y = dynamic_cast<const Number &>(_y);
		interpreter.pushPolizElement(Number(x.getValue() - y.getValue()));
	} catch(bad_cast&) {
		throw std::logic_error("Operation `" + toString() + "' requires 2 numbers as arguments");
	}
}
开发者ID:Kirill1543,项目名称:Interpretator3,代码行数:10,代码来源:Operation.cpp


示例9: Next

void Next(Point p)
{
	Point p1, p2; //p2存储下一步要走的位置 p1存储当前位置
	p2=p;
	while(step < N * N)
	{
		InitStack(s[step]);
		board[p.x][p.y] = step;
		Push(s1, p); //将当前位置压入s1
		Exit(p);
		Pop(s[step], p2); 
		if ((s[step].base == s[step].top && Number(p2) == 0) && step != N * N - 1) //s[step]为空栈 下一步不能走了 步数没有到64
		{ 
			Pop(s1, p1); //把当前位置从临时栈s1里pop出来
			board[p1.x][p1.y] = 0; 
			--step; 
			while (s[step].base == s[step].top) 
			{
				Pop(s1, p1); 
				board[p1.x][p1.y] = 0;
				step--; //一直回溯到下步能走为止
			}
			Pop(s[step], p2); //换一种下一步的走法
			step++;
			p=p2;
			
		}
		else if (Number(p2) == 0 && s[step].base != s[step].top)
		{
			Pop(s[step], p2); 
			step++;
			p=p2;
			
		}
		else
		{
			step++;
			p=p2;
			
		}
	}
	board[p.x][p.y] = step;
}
开发者ID:huihuizhang,项目名称:algorithm,代码行数:43,代码来源:chess.cpp


示例10: Next

void Next(Point p) //找出各个位置并将其步数记录
{
	Point p1,p2; //p2存储下一步要走的位置 p1存储当前位置
	InitStack(s[step]);
	board[p.x][p.y]=step;
	Push(s1,p); //将当前所在位置压入临时栈s1
	if (step<N*N)
	{
		Exit(p);
		Pop(s[step],p2); //p2是从s[step]里pop出来的
		if ((s[step].base==s[step].top&&Number(p2)==0)&&step!=N*N-1) //s[step]为空栈 下一步不能走了 步数没有到64
		{ //这个时候我们需要回溯操作
			Pop(s1,p1); //把当前位置从临时栈s1里pop出来
			board[p1.x][p1.y]=0; //清零操作
			--step; //步数减1
			while (s[step].base==s[step].top) //清除s[step]栈为空栈
			{
				Pop(s1,p1); //从s1中弹栈放到p1中
				board[p1.x][p1.y]=0;
				step--; //一直回溯到能走为止
			}
			Pop(s[step], p2); //换一种下一步的走法
			step++;
			Next(p2);
		}
		else if (Number(p2)==0&&s[step].base!=s[step].top)//下一步没有走的位置 栈不为空
		{
			Pop(s[step],p2); //换一种下一步的走法
			step++;
			Next(p2);
		}
		else if (Number(p2)!=0&&s[step].base==s[step].top)//下一步有走的位置 但是栈s[step]为空
		{ //直接走下一步
			step++;
			Next(p2);
		}
		else
		{
			step++;
			Next(p2);
		}
	}
}
开发者ID:lijuanLin,项目名称:Code,代码行数:43,代码来源:马踏棋盘.c


示例11: Number

thing_th *dirty_sub(thing_th *args) {
    long num=0;
    char *outty;
    thing_th *output;
    if(!args)
        return Number("0");
    if(Cdr(args)) {
        num=text_to_long(Car(args));
        args=Cdr(args);
    }
    while(args) {
        num-=text_to_long(Car(args));
        args=Cdr(args);
    }
    asprintf(&outty, "%ld", num);
    output=Number(outty);
    erase_string(outty);
    return output;
}
开发者ID:gregghz,项目名称:funky,代码行数:19,代码来源:funky_op.c


示例12: Number

Data::Data(const Data& right)
{
	tree = right.tree;
	std::strcpy(this->name,right.name);
	this->storedData = Number(right.storedData);
	this->doesDataInited = true;
	doesTreeInited = false;
	this->type = right.type;
	this->priority = right.priority;
}
开发者ID:ozeron,项目名称:Calculator,代码行数:10,代码来源:Data.cpp


示例13: assert

		Serializer& DefaultSerializer::operator <<(const dtn::data::Block& obj)
		{
			_stream.put((char&)obj.getType());
			_stream << obj.getProcessingFlags();

			const Block::eid_list &eids = obj.getEIDList();

#ifdef __DEVELOPMENT_ASSERTIONS__
			// test: BLOCK_CONTAINS_EIDS => (eids.size() > 0)
			assert(!obj.get(Block::BLOCK_CONTAINS_EIDS) || (eids.size() > 0));
#endif

			if (obj.get(Block::BLOCK_CONTAINS_EIDS))
			{
				_stream << Number(eids.size());
				for (Block::eid_list::const_iterator it = eids.begin(); it != eids.end(); ++it)
				{
					dtn::data::Dictionary::Reference offsets;

					if (_compressable)
					{
						offsets = (*it).getCompressed();
					}
					else
					{
						offsets = _dictionary.getRef(*it);
					}

					_stream << offsets.first;
					_stream << offsets.second;
				}
			}

			// write size of the payload in the block
			_stream << Number(obj.getLength());

			// write the payload of the block
			Length slength = 0;
			obj.serialize(_stream, slength);

			return (*this);
		}
开发者ID:abrahammartin,项目名称:ibrdtn,代码行数:42,代码来源:Serializer.cpp


示例14: test_specific

void test_specific(const boost::mpl::int_<boost::multiprecision::number_kind_integer>&)
{
   if(std::numeric_limits<Number>::is_modulo)
   {
      if(!std::numeric_limits<Number>::is_signed)
      {
         BOOST_TEST(1 + (std::numeric_limits<Number>::max)() == 0);
         BOOST_TEST(--Number(0) == (std::numeric_limits<Number>::max)());
      }
   }
}
开发者ID:AntonBikineev,项目名称:multiprecision,代码行数:11,代码来源:test_numeric_limits.cpp


示例15: while

static thing_th *read_literals(FILE *src, text_buffer *tb, int inputChar) {
    while(!literal_terminator_char(inputChar)) {
        tb_append(tb, inputChar);
        inputChar=get_character(src);
    }
    if(!is_whitespace(inputChar))
        ungetc(inputChar, src);
    if(is_decimal_text(tb->txt))
        return read_subcons(Number(tb->txt), src, tb);
    return read_subcons(Atom(tb->txt), src, tb);
}
开发者ID:gregghz,项目名称:funky,代码行数:11,代码来源:funky_read.c


示例16: IntArrayToString

void cChannel::SetCaIds(const int *CaIds)
{
  if (caids[0] && caids[0] <= CA_USER_MAX)
     return; // special values will not be overwritten
  if (IntArraysDiffer(caids, CaIds)) {
     char OldCaIdsBuf[MAXCAIDS * 5 + 10]; // 5: 4 digits plus delimiting ',', 10: paranoia
     char NewCaIdsBuf[MAXCAIDS * 5 + 10];
     IntArrayToString(OldCaIdsBuf, caids, 16);
     IntArrayToString(NewCaIdsBuf, CaIds, 16);
     if (Number())
        dsyslog("changing caids of channel %d from %s to %s", Number(), OldCaIdsBuf, NewCaIdsBuf);
     for (int i = 0; i <= MAXCAIDS; i++) { // <= to copy the terminating 0
         caids[i] = CaIds[i];
         if (!CaIds[i])
            break;
         }
     modification |= CHANNELMOD_CA;
     Channels.SetModified();
     }
}
开发者ID:FFTEAM,项目名称:evolux-spark-sh4,代码行数:20,代码来源:channels.c


示例17: INIT_FEEDBACK

	/**
	 * \note A state variable will be reset when no feedback instruction is used on it in a single run.
	 *       It will be reinitialized by the next time INIT_FEEDBACK is executed.
	 * 
	 * \param Int The index of the state variable.
	 * \param Address The function to give the initial value, if not yet set.
	 * 
	 * \return Data The value of the state variable.
	 */
	void INIT_FEEDBACK(Machine & machine){
		Index state_index = machine.nextInt();
		Address initialization_function = machine.stack.popAddress();
		machine.state[state_index].is_executed = true;
		machine.state[state_index].thread = machine.currentThreadId();
		if (machine.state[state_index].data.isSet()){
			machine.stack.push(machine.state[state_index].data);
		} else {
			machine.stack.push(Number(state_index));
			machine.call(initialization_function, INIT_FEEDBACK_set_state);
		}
	}
开发者ID:delftproto,项目名称:delftproto,代码行数:21,代码来源:feedback.cpp


示例18: strcmp

void cChannel::SetName(const char *Name, const char *ShortName, const char *Provider)
{
  if (!isempty(Name)) {
     bool nn = strcmp(name, Name) != 0;
     bool ns = strcmp(shortName, ShortName) != 0;
     bool np = strcmp(provider, Provider) != 0;
     if (nn || ns || np) {
        if (Number()) {
           dsyslog("changing name of channel %d from '%s,%s;%s' to '%s,%s;%s'", Number(), name, shortName, provider, Name, ShortName, Provider);
           modification |= CHANNELMOD_NAME;
           Channels.SetModified();
           }
        if (nn)
           name = strcpyrealloc(name, Name);
        if (ns)
           shortName = strcpyrealloc(shortName, ShortName);
        if (np)
           provider = strcpyrealloc(provider, Provider);
        }
     }
}
开发者ID:FFTEAM,项目名称:evolux-spark-sh4,代码行数:21,代码来源:channels.c


示例19: image__N4_labelling_long

/*------------------------------------------------------------------------*
 * 4近傍のラベリング。できあがりはlong型
 *------------------------------------------------------------------------*/
long image__N4_labelling_long(image label, image original)
{
  f_caller caller;

  caller = (f_caller)image__caller("N4_labelling_long",
				   original,
				   Number(N4_long_table),N4_long_table);

  if (caller) return caller(label,original);

  return 0;
}
开发者ID:molmol178,项目名称:cv,代码行数:15,代码来源:labelling4.c


示例20: fdetermine_trace_type

/*
 * Determine the trace type for FILE * 'fp'.
 *
 * NB - This function should NOT be used when biolims support is required
 * (as biolims doesn't use files !)
 *
 * Returns:
 *     TT_SCF, TT_CTF, TT_ZTR, TT_ABI, TT_ALF, or TT_PLN for success.
 *     TT_UNK for unknown type.
 *     TT_ERR for error.
 */
int fdetermine_trace_type(FILE *fp)
{
    unsigned int i;
    size_t len;
    char buf[512];
    int ps;
    int acgt;
    int c;

    /* check magics */
    for (i = 0 ; i < Number(magics) ; i++) {
	if (fseek(fp,magics[i].offset,0) == 0) {
	    len = strlen(magics[i].string);
	    if (fread(buf,1,len,fp)==len) {
		if (strncmp(buf,magics[i].string,len)==0) {
		    return magics[i].type;
		}
	    }
	}
    }
    fseek(fp, 0, 0);

    /* determine if this is a text file */
    len = 0; ps = 0; acgt = 0;
    for (i = 0; i < 512; i++) {
	if ( ( c = fgetc(fp) ) == EOF ) break;
	switch(c) {
	case 'a': case 'c': case 'g': case 't':
	case 'A': case 'C': case 'G': case 'T':
	/*YUK! need the next line?*/
	case 'n': case 'N': case '-':
	    acgt++;
	default:
	    len++;
	    if ( (isprint(c) && isascii(c)) || isspace(c) ) ps++;
	}
    }
    fseek(fp, 0, 0);
    /*YUK! 75% of characters printable means text*/
    if ( 100 * (size_t)ps > 75 * len ) {
	/*YUK! 75% of printables ACGTN means plain*/
	if (100 * acgt > 75 * ps) {
	    return TT_PLN;
	}
    }

    /* YUK! short files are not traces? */
    if (len<512) {
        return TT_UNK;
    }

    return TT_UNK;
}
开发者ID:svn2github,项目名称:staden-io_lib,代码行数:64,代码来源:traceType.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ NumberToString函数代码示例发布时间:2022-05-30
下一篇:
C++ NumToString函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap