All the ranges should differ at most 1 in size.my @ranges = map {[int($_*($M+1)/$N), int(($_+1)*(($M+1)/$N))-1]} 0..$ +N - 1;
In reply to Re: Split range 0 to M into N non-overlapping (roughly equal) ranges.
by JavaFan
in thread Split range 0 to M into N non-overlapping (roughly equal) ranges.
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |