Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: df41400ae9
Fetching contributors…

Cannot retrieve contributors at this time

file 19 lines (15 sloc) 0.278 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

my $N;
BEGIN { $N = 20 };
use Test::More tests => $N;
use Math::SternBrocot;

sub odd_denom {
  $_[0][1] % 2 == 1;
}

{
  my $sb = Math::SternBrocot->new;
  $sb->set_filter(\&odd_denom);

  for (1 .. $N) {
    my $f = $sb->pull;
    ok(odd_denom($f), "$f->[0]/$f->[1]");
  }
}
Something went wrong with that request. Please try again.