Created
May 14, 2014 18:38
-
-
Save pfactum/d734e3ce22d7628774fd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
index="0" | |
sum1="0" | |
sum2="0" | |
sum1n="2080" | |
sum2n="4.74389090370576902576" | |
echo -n "" >test.out | |
for i in $(seq 1 64) | |
do | |
sum1=$(echo "$sum1+$i/$sum1n" | bc -l) | |
sum2=$(echo "$sum2+(1/$i)/$sum2n" | bc -l) | |
echo -e "$i\t$sum1\t$sum2" >>test.out | |
done | |
echo "plot 'test.out' using 1:2 with lines title 'int', 'test.out' using 1:3 with lines title 'float'" | gnuplot -persist | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment