[C++-sig] boost/python/slice.hpp
Jonathan Brandmeyer
jbrandmeyer at earthlink.net
Thu Jul 8 18:58:54 CEST 2004
On Thu, 2004-07-08 at 12:32, Jonathan Brandmeyer wrote:
> Since ret.stop is guaranteed to be a multiple of ret.step away from
> ret.start, this statement should get it for you (the signs also work out
> in the reverse case):
>
> int size = (ret.stop - ret.start) / ret.step;
And since it is an inclusive range, make that:
int size = (ret.stop - ret.start) / ret.step + 1;
-Jonathan
More information about the Cplusplus-sig
mailing list