示例#1
0
vector<SMS> MakerModem::getSMSBySender(const char * number)
{
	vector<SMS> list;
	string cleaned(clean_number(number));
	for (std::vector<SMS>::iterator it = messages.begin(); it != messages.end(); ++it) {
		string current = it->getSender();
		if (strcmp(cleaned.c_str(), clean_number(current.c_str()).c_str()) == 0)
			list.push_back(*it);
	}
	return list;
}
示例#2
0
stBigNum multiply(stBigNum tNumX, stBigNum tNumY){
	stBigNum tResult;
	clean_number(&tResult);
	while(!equal_zero(&tNumX)){
		if(odd(tNumX.aiBlock[0])){
			tResult = add(tResult, tNumY);
		}
		shift_r(&tNumX);
		shift_l(&tNumY);
	}
	return (tResult);
}
示例#3
0
void read(stBigNum *ptNum){
	int i, iPower = 1;
	char pszString[LON*MAXN];
	scanf("%s",pszString);
	clean_number(ptNum);
	for(i=strlen(pszString)-1; i>=0; i--){
		ptNum->aiBlock[ptNum->iSize-1] += (((int)pszString[i])-48)*iPower;
		iPower *= 10;
		if(iPower == CARRY){
			iPower = 1;
			ptNum->iSize++;
		}
	}
}