Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

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

by mr_mischief (Monsignor)
on Mar 16, 2011 at 04:50 UTC ( #893494=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    [chris@pineapple ranges-892828]$ perl ranges -M=15 -N=12
     0 : from       0 to       0 (      1)
    ...
     9 : from      10 to      10 (      1)
    10 : from      11 to      11 (      1)
    11 : from      12 to      12 (      1)
    
  2. or download this
    [chris@pineapple ranges-892828]$ perl -Mbignum ranges -M=14 -N=11
     0 : from       0 to       0 (      1)
    ...
     9 : from      10 to      10 (      1)
    10 : from      11 to      11 (      1)
    11 : from      12 to      13 (      2)
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2021-10-26 18:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (90 votes). Check out past polls.

    Notices?