in reply to Re^3: Near equal partitions.
in thread Near equal partitions.

btw, what about use integer? It looks it's little bit faster with that.

Replies are listed 'Best First'.
Re^5: Near equal partitions.
by JavaFan (Canon) on Jan 14, 2011 at 09:40 UTC
    There's benchmarking code elsewhere in the thread. It should be easy to add a 'use integer' case.
      with that code
      sub ikei { my ($n, $m) = @_; use integer; my $q = $n / $m; my $r = $n % $m; return ($q+1) x $r, ($q) x ($m-$r); }
      Rate ike ikei ike 50.8/s -- -4% ikei 52.8/s 4% -- Rate ike ikei ike 50.5/s -- -5% ikei 52.9/s 5% --