Bin-Subtotal
view release on metacpan or search on metacpan
scripts/summing view on Meta::CPAN
& doPrint ;
}
}
sub printOutput () {
#my $FH = $o{1} ? \* STDOUT : \*STDERR ; # <-- æå³ããã£ãã®ã???
select $o{1} ? \* STDOUT : \*STDERR ; # <-- æå³ããã£ãã®ã???
print $o{q}? '' : 'header=' , qq{'$header'\t} if $o{'='} ;
my $fmt = $o{q} ? "%s\t%d\t%g\t%s" : "%s <- sum ;\t%d + %d <- counted + not ; \t%s <- average ;" ;
#$fmt = "%50X <- sum ;\t%d + %d <- counted + not ;" if $o{h} ;
my $quot = $lln != 0 ? $sum/$lln : "NaN" ;
if ( "$quot" > $quot ) { $quot = "$quot" . '..(-)' }
elsif ( "$quot" < $quot ) { $quot = "$quot" . '..(+)' }
#if ( $o{h} ) { say sprintf( & hex8 ( $sum) ; return } ;
$sum = & hex8 ( $sum ) if $o{h} ;
say sprintf ($fmt , $sum, $lln, $nlln , "$quot") , sprintf "\t%0.6f sec calculation (summing)." , tv_interval ${ dt_start } ;
}
sub hex8 {
my @out = '' ;
my $n = $_ [0] ; $n = 0 if $n eq "NaN" ;
my $c = 12 ;
do {my $t = $n % 16**8 ; $n = int $n /16**8 ; unshift @out , sprintf "%08x" , $t ; say $n } while ($n != 0 && $c--) ;
my $out = join " " , @out ;
$out =~ s/^00+/0x 0/;
return $out ;
}
sub VERSION_MESSAGE {}
sub HELP_MESSAGE{
( run in 0.237 second using v1.01-cache-2.11-cpan-4d50c553e7e )