// Count allowed weekdays in a half-open span using a seven-value flag vector and the supplied starting weekday from zero to six. pub fn weekday_mask_count(start_day: i64, days: i64, enabled: vector) -> i64 { if start_day<0 || start_day >= 7 || days<0 || len(enabled)!=7 { return -1; } let mut count = 0; let mut d = 0; while d<7 { if at(enabled,(start_day+d)%7)>0.0 { count += days/7; if d