Skip to content

Commit 3b08cc3

Browse files
committed
Add SQRT column
1 parent af14ff6 commit 3b08cc3

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ genrom: genrom.c
44

55

66
raw2plot: raw2plot.c
7-
7+
$(CC) $< -o $@ -lm

raw2plot.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#include <stdio.h>
1010
#include <stdlib.h>
11+
#include <math.h>
1112

1213
FILE *in, *out;
1314

@@ -33,12 +34,12 @@ static void print(float n)
3334
ssize_t r;
3435
float f;
3536

36-
fprintf(out, "#sample out env\n");
37+
fprintf(out, "#sample out env sqrt(env)\n");
3738
i = 0;
3839
while ((r = fread(&f, sizeof(float), 1, in)) == 1)
3940
{
4041
float e = env(f)/n;
41-
fprintf(out, "%ld %f %f\n", i++, f, e);
42+
fprintf(out, "%ld %f %f %f\n", i++, f, e, sqrtf(e));
4243
}
4344
}
4445

0 commit comments

Comments
 (0)