本文整理汇总了C++中Number函数的典型用法代码示例。如果您正苦于以下问题:C++ Number函数的具体用法?C++ Number怎么用?C++ Number使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Number函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
}
示例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;
}
示例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());
}
}
示例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;
}
}
}
示例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);
}
示例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);
}
示例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));
}
示例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");
}
}
示例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;
}
示例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);
}
}
}
示例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;
}
示例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;
}
示例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);
}
示例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)());
}
}
}
示例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);
}