Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^3: Split range 0 to M into N non-overlapping (roughly equal) ranges.

by JavaFan (Canon)
on Mar 13, 2011 at 11:08 UTC ( #892939=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub ranges_javafan {
      my ($M, $N) = @_;
    ...
                     , int((($_+1)/$N)*($M+1))-1]
                  } 0..$N - 1];
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://892939]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (10)
As of 2021-10-22 09:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (85 votes). Check out past polls.

    Notices?