Lines Matching refs:step
8 long step; member
16 get_len_of_range(long lo, long hi, long step) in get_len_of_range() argument
31 assert(step != 0); in get_len_of_range()
32 if (step > 0 && lo < hi) in get_len_of_range()
33 return 1UL + (hi - 1UL - lo) / step; in get_len_of_range()
34 else if (step < 0 && lo > hi) in get_len_of_range()
35 return 1UL + (lo - 1UL - hi) / (0UL - step); in get_len_of_range()
57 last = (long)(r->start + (unsigned long)(r->len - 1) * r->step); in get_stop_for_range()
58 if (r->step > 0) in get_stop_for_range()
59 return last > LONG_MAX - r->step ? LONG_MAX : last + r->step; in get_stop_for_range()
61 return last < LONG_MIN - r->step ? LONG_MIN : last + r->step; in get_stop_for_range()
102 obj->step = istep; in range_new()
124 return PyInt_FromLong((long)(r->start + (unsigned long)i * r->step)); in range_item()
138 if (r->start == 0 && r->step == 1) in range_repr()
142 else if (r->step == 1) in range_repr()
151 r->step); in range_repr()
162 r->step); in range_reduce()
232 long step; member
240 return PyInt_FromLong(r->start + (r->index++) * r->step); in rangeiter_next()
304 it->step = ((rangeobject *)seq)->step; in range_iter()
313 long start, step, len; in range_reverse() local
324 step = ((rangeobject *)seq)->step; in range_reverse()
341 it->start = (long)(start + (unsigned long)(len-1) * step); in range_reverse()
342 it->step = (long)(0UL-step); in range_reverse()