diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /security/nss/lib/freebl/mpi/stats | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'security/nss/lib/freebl/mpi/stats')
-rwxr-xr-x | security/nss/lib/freebl/mpi/stats | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/security/nss/lib/freebl/mpi/stats b/security/nss/lib/freebl/mpi/stats new file mode 100755 index 000000000..a5deb94c0 --- /dev/null +++ b/security/nss/lib/freebl/mpi/stats @@ -0,0 +1,39 @@ +#!/usr/bin/perl + +# +# Treat each line as a sequence of comma and/or space delimited +# floating point numbers, and compute basic statistics on them. +# These are written to standard output + +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +$min = 1.7976931348623157E+308; +$max = 2.2250738585072014E-308; +$sum = $num = 0; + +while(<>) { + chomp; + + @nums = split(/[\s,]+/, $_); + next if($#nums < 0); + + $num += scalar @nums; + foreach (@nums) { + $min = $_ if($_ < $min); + $max = $_ if($_ > $max); + $sum += $_; + } +} + +if($num) { + $avg = $sum / $num; +} else { + $min = $max = 0; +} + +printf "%d\tmin=%.2f, avg=%.2f, max=%.2f, sum=%.2f\n", + $num, $min, $avg, $max, $sum; + +# end |