Lab 2 Hints

I've attached lab2.c, the starter C code for Lab 2, except with more hints in the comments. Check it out. I changed one line in it in pi_float() from:

unsigned int denom = ...;

to:

float denom = ...;

For purposes of our lab, it won't affect our accuracy, and people were forgetting to cast to float before dividing.

As requested, I've also attached lab2.out, the expected output for Lab2. Note that it is quite large, but the lines of interest are 1, 2052, 13261. Note that if your pi approximation is slightly different, then that is OK.

lab2.c

lab2.out

Back to top
blog/lab_2_hints.txt · Last modified: 2009/09/03 16:49 by jeffk