summaryrefslogtreecommitdiff
path: root/lin_reg2.awk
diff options
context:
space:
mode:
authorwukong <wukong@longaeva>2018-06-18 04:00:29 -0700
committerwukong <wukong@longaeva>2018-06-18 04:00:29 -0700
commitc44ac59acbb18c6982e180637566dec8eb9baebd (patch)
tree66ea1e51ed0a60b2fdf48ea1b1c5b852007a05fd /lin_reg2.awk
parent2482727a6902e44e6a68236f878f5f9bf7947bd2 (diff)
adjusted print statements to use OFMT, OFS, and ORS;
Diffstat (limited to '')
-rw-r--r--lin_reg2.awk4
1 files changed, 2 insertions, 2 deletions
diff --git a/lin_reg2.awk b/lin_reg2.awk
index 7c00fe8..ef0fe57 100644
--- a/lin_reg2.awk
+++ b/lin_reg2.awk
@@ -4,7 +4,7 @@
# simple linear regression between columns
BEGIN {
- OFMT = "%.18g"
+ OFMT = "%.8g"
sign = "[+-]?"
decimal = "[0-9]+[.]?[0-9]*"
fraction = "[.][0-9]*"
@@ -82,7 +82,7 @@ END {
for (y=1; y<=nf_max; y++) {
for (x=1; x<=nf_max; x++) {
if (x != y && r[x,y]) {
- printf("\n %.18g \t (%s) \t = (%.18g +/- %.18g)(%s) \t + (%.18g +/- %.18g)",
+ printf(OFMT OFS "(%s)" OFS " = (" OFMT " +/- " OFMT ")(%s)" OFS " + (" OFMT " +/- " OFMT ")" ORS,
10.0*log(r[x,y]*r[x,y])/log(10), header[y], b[x,y], b_err[x,y], header[x],
a[x,y], a_err[x,y])
}