std::string get_vertex_properties_list() { //! vertex property output string std::string v_out; // write the number of vertex v_out += "VERTICES " + std::to_string(get_total()) + " " + std::to_string(get_total() * 2) + "\n"; // return the vertex properties string return v_out; }
int main() { inode_table_tests(); util_tests(); if (get_failed() == 0) { printf("%d out of %d tests passed! :) \n", get_passed(), get_total()); return 0; } else { printf("unfortunately %d out of %d tests failed! :( \n", get_failed(), get_total()); return -1; } }
std::string get_point_data_header() { std::string v_out; v_out += "POINT_DATA " + std::to_string(get_total()) + "\n"; return v_out; }
void get_avg_local(){ uint16_t total; uint16_t count; uint16_t avg; total=get_total(get_root()); count=count_nodes(get_root()); avg=total/count; printf("the average is : %d\n",avg); }
std::string get_point_properties_list() { //! vertex property output string std::string v_out; // write the number of vertex v_out += "POINTS " + std::to_string(get_total()) + " float" + "\n"; // return the vertex properties string return v_out; }
int eval_expr_deep(char *str) { int *tab_nbr; int *tab_op; int count[2]; int total; tab_nbr = get_nbr(str, count); tab_op = get_op(str, count); total = get_total(tab_nbr, tab_op, count); return (total); }
void RestaurantOrder::read_back_order( string& mFull_order ) { mFull_order = "Okay, your order is: "; read_back_items( mFull_order ); float SumTotal = get_total(); mFull_order += ". And your total is "; char total[12]; sprintf(total, "$%6.2f. ", SumTotal); mFull_order += total; just_read_back = 1; }
int devfs_readdir_r(const void * cfg, void * handle, int loc, struct dirent * entry){ int total; const devfs_device_t * dev_list = (const devfs_device_t*)cfg; //the cfg value is the device list //this populates the entry for the loc position total = get_total(dev_list); if ( (uint32_t)loc < total ){ strcpy(entry->d_name, dev_list[loc].name); entry->d_ino = loc; return 0; } return SYSFS_SET_RETURN(ENOENT); }
int main() { for (;;) { long long total = 0; if (!get_total(&total)) { break; } printf("%Ld\n", total); } return 0; }
void CharStats::close_totalstats() { totalstats[Equipstat::ACC] += calculateaccuracy(); for (auto iter : percentages) { Equipstat::Id stat = iter.first; int32_t total = totalstats[stat]; total += static_cast<int32_t>(total * iter.second); set_total(stat, total); } int32_t primary = get_primary_stat(); int32_t secondary = get_secondary_stat(); int32_t attack = get_total(Equipstat::WATK); float multiplier = damagepercent + static_cast<float>(attack) / 100; maxdamage = static_cast<int32_t>((primary + secondary) * multiplier); mindamage = static_cast<int32_t>(((primary * 0.9f * mastery) + secondary) * multiplier); }
int32_t CharStats::get_secondary_stat() const { Equipstat::Id secondary = job.get_secondary(weapontype); return get_total(secondary); }
float VideoStreamTheora::get_time() const { //print_line("total: "+itos(get_total())+" todo: "+itos(get_todo())); //return MAX(0,time-((get_total())/(float)vi.rate)); return time-((get_total())/(float)vi.rate); };
int get_total_wrote() { return total_wrote - (get_total() - get_todo()); };
// returns `true` if there was critical compression ratio bool eval_compression(VConTextPart* parts, unsigned l, unsigned r, int a_req_len) { _ASSERTE(l<=r && a_req_len>0); if (l == r) { _ASSERTE(data!=NULL); data[0].old_width = parts[l].TotalWidth; data[0].new_width = a_req_len; return ((data[0].new_width * 2) < data[0].old_width); } bool bCritical = false; float total_k = 1.0; int total_l = 0; int delta; int req_len = a_req_len; get_total(parts, l, r, total_k, total_l); #ifdef _DEBUG if (!data || (data_count < (r-l+1))) { _ASSERTE(data && (data_count >= (r-l+1))); } #endif float F = total_k * (total_l - req_len); float add_half = (F > 0) ? 0.5 : -0.5; unsigned half_cell = (cell_width > 3) ? (cell_width/2) : 1; for (unsigned i = l; (i < r) && (req_len < total_l); i++) { if (!parts[i].TotalWidth) { _ASSERTE(parts[i].CharFlags[0] == TCF_WidthZero); continue; } data[i-l].delta = (F / data[i-l].part_elast); delta = floor(data[i-l].delta + add_half); //printf("#%i: float=%.3f delta=%u\n", i+1, d, delta); _ASSERTE((delta+half_cell-1) <= parts[i].TotalWidth); _ASSERTE(parts[i].TotalWidth > half_cell); if ((delta + half_cell) <= (parts[i].TotalWidth + 1)) { data[i-l].new_width = (parts[i].TotalWidth - delta); } else { data[i-l].new_width = half_cell; delta = data[i-l].old_width - data[i-l].new_width; bCritical = true; } total_l -= delta; } // Let last part lasts to the end of dedicated space if (l < r) { data[r-l].delta = (F / data[r-l].part_elast); if (a_req_len < total_l) { delta = (total_l - a_req_len); if ((delta + half_cell) >= parts[r].TotalWidth) { bCritical = true; //_ASSERTE(delta < parts[r].TotalWidth); } data[r-l].new_width = (delta < parts[r].TotalWidth) ? (parts[r].TotalWidth - delta) : half_cell; } } return bCritical; };
void CharStats::add_buff(Equipstat::Id stat, int32_t value) { int32_t current = get_total(stat); set_total(stat, current + value); buffdeltas[stat] += value; }
void get_total_local(){ uint16_t shorter; shorter=get_total(get_root()); printf("total for all keys is : %d\n",shorter); }
void CharStats::add_value(Equipstat::Id stat, int32_t value) { int32_t current = get_total(stat); set_total(stat, current + value); }
int32_t CharStats::get_primary_stat() const { Equipstat::Id primary = job.get_primary(weapontype); return static_cast<int32_t>(get_multiplier() * get_total(primary)); }
int32_t CharStats::calculateaccuracy() const { int32_t totaldex = get_total(Equipstat::DEX); int32_t totalluk = get_total(Equipstat::LUK); return static_cast<int32_t>(totaldex * 0.8f + totalluk * 0.5f); }
int32_t CharStats::calculate_damage(int32_t mobatk) const { // random stuff, need to find the actual formula somewhere int32_t reduceatk = mobatk / 2 + mobatk / get_total(Equipstat::WDEF); return reduceatk - static_cast<int32_t>(reduceatk * reducedamage); }