App-denomfind

 view release on metacpan or  search on metacpan

bin/denomfind  view on Meta::CPAN

my $ymx = max ( exists $o{y} ? & yparse ( $o{y} ) : $q ) ; # y max # 計算が冗長.. 何度も気になる。ƒexp
my $roa = abs 1/$o{a} if exists $o{a} ; # reciprocal $o{a}

my $count = 0 ; # 探索した分母の個数
my $denom = do { $o{g} =~ s/(.+),// && $1 } || 1 ; # 開始する分母の値  $o{g} を書き換える場合に注意。
& main () ; 
END{
  exit unless $count ; # 1個も分母を探索していないなら、すぐ終了。
  exit if 0 eq ($o{2}//'') ;
  my $sum = 0 ; $sum = "$sum" + "$_" for @nums ; 
  my $bf = color 'bold faint white' ;
  print STDERR $bf . scalar @nums . " ratios are given (sum=" . color('reset bold yellow').($sum) . $bf .")." if @nums > 1 ; 
  my $ud = [ 'down to','from','up to' ] -> [ ( $o{g} <=> 0 ) + 1 ] ; # 'from' はかなり無理矢理である。正常な使用の想定外。
  $denom += $o{g} > 0 ? -1 : $o{g} < 0 ? 1 : 0 ; # 1個戻す。
  say STDERR BOLD FAINT " $count denominators have found $ud $denom. ($Script)" ; 
}
exit 0 ;

sub main ( ) { 
  
  my ( @nA , @nB ,@nC) ; # 区間の 閉じた端A と 開いた端B , Cが1の場合。 もしCが0から開区間で、2なら閉区間。
  do { my($A,$B,$C)= realInt ($_) ; push @nA,$A ; push @nB,$B ; push @nC,$C } for @nums ; 



( run in 1.456 second using v1.01-cache-2.11-cpan-c333fce770f )