Skip to content

Commit

Permalink
Add SQRT column
Browse files Browse the repository at this point in the history
  • Loading branch information
glguida committed May 14, 2020
1 parent af14ff6 commit 3b08cc3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ genrom: genrom.c


raw2plot: raw2plot.c

$(CC) $< -o $@ -lm
5 changes: 3 additions & 2 deletions raw2plot.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

FILE *in, *out;

Expand All @@ -33,12 +34,12 @@ static void print(float n)
ssize_t r;
float f;

fprintf(out, "#sample out env\n");
fprintf(out, "#sample out env sqrt(env)\n");
i = 0;
while ((r = fread(&f, sizeof(float), 1, in)) == 1)
{
float e = env(f)/n;
fprintf(out, "%ld %f %f\n", i++, f, e);
fprintf(out, "%ld %f %f %f\n", i++, f, e, sqrtf(e));
}
}

Expand Down

0 comments on commit 3b08cc3

Please sign in to comment.