App-denomfind

 view release on metacpan or  search on metacpan

bin/denomfind  view on Meta::CPAN

10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#
 
use 5.024 ; use strict ; use warnings# s/のr修飾子は v5.14を要求
use Getopt::Std ; getopts 'a:cD:fg:IL:M:QT:y:%2:5:' , \my%o ;
use POSIX qw[ ceil floor ] ;
use Term::ANSIColor qw[ :constants color ] ; $Term::ANSIColor::AUTORESET = 1 ;
use Math::BigInt qw[ bgcd ] ; # -Qの指定時に必要となる。
use List::Util qw [ reduce min max ] ;
use FindBin qw[ $Script ] ;
my $mpu ; # Math::Prime::Util のモジュールがインストールされているか点検。
CHECK {$mpu = eval 'use Math::Prime::Util qw[ factor factor_exp ]; 1 ' || 0 } # 他にBEGIN INIT UNITCHECK が使える。
& test if exists $o{T} ;
HELP_MESSAGE () unless @ARGV ;
 
### テストパターン
sub test () {
  my $cmd ;
  do {
    no warnings qw [experimental::smartmatch];
    $cmd = "$0 -D0 -M0 -y-2.. -52 -Q -% 4.76 3.94 3.50 26.37 3.58 2.72" when '1'  ;
    $cmd = "$0 -g8 -D-6%% -a5e-5 -y, 3.14159265358979323" when  '2'  ;



( run in 1.122 second using v1.01-cache-2.11-cpan-9b1e4054eb1 )